Avoid array-bounds warnings with gcc 4.8.2
[alexxy/gromacs.git] / src / gromacs / gmxlib / pbc.c
index b9e48a236f525387c747e9c806da3c663b61f903..c2ceaef80d67c6ba9f39281e2b3024c1f2ee56e5 100644 (file)
@@ -39,6 +39,8 @@
 #endif
 
 #include <math.h>
+#include <assert.h>
+
 #include "sysstuff.h"
 #include "typedefs.h"
 #include "vec.h"
@@ -395,6 +397,7 @@ static void low_set_pbc(t_pbc *pbc, int ePBC, ivec *dd_nc, matrix box)
                         pbc->dim = i;
                     }
                 }
+                assert(pbc->dim < DIM);
                 for (i = 0; i < pbc->dim; i++)
                 {
                     if (pbc->box[pbc->dim][i] != 0)