Avoid array-bounds warnings with gcc 4.8.2
[alexxy/gromacs.git] / src / gromacs / gmxpreprocess / x2top.c
index 4246eb7ee74bab66cf94c3bb136af0b60318e675..b3d051cb1273a3edb81f271b3907dcb5f6662943 100644 (file)
@@ -40,6 +40,8 @@
 #include <config.h>
 #endif
 
+#include <assert.h>
+
 #include "copyrite.h"
 #include "gromacs/math/utilities.h"
 #include "macros.h"
@@ -265,6 +267,7 @@ void lo_set_force_const(t_params *plist, real c[], int nrfp, gmx_bool bRound,
                 c[0] += 180;
             }
         }
+        assert(nrfp <= MAXFORCEPARAM/2);
         for (j = 0; (j < nrfp); j++)
         {
             plist->param[i].c[j]      = c[j];