Avoid array-bounds warnings with gcc 4.8.2
[alexxy/gromacs.git] / src / gromacs / gmxpreprocess / grompp.c
index 49529521e263205c29cf3d32495d8b2ba306c62b..b337cd6b612d6aeb19e6fe5979d0fea7a458a6f0 100644 (file)
@@ -45,6 +45,7 @@
 #include <string.h>
 #include <errno.h>
 #include <limits.h>
+#include <assert.h>
 
 #include "sysstuff.h"
 #include "smalloc.h"
@@ -887,6 +888,8 @@ static void read_posres(gmx_mtop_t *mtop, t_molinfo *molinfo, gmx_bool bTopB,
 
     if (rc_scaling != erscNO)
     {
+        assert(npbcdim <= DIM);
+
         for (mb = 0; mb < mtop->nmolblock; mb++)
         {
             molb     = &mtop->molblock[mb];