endif()
GMX_TEST_CFLAG(CFLAGS_WARN "-Wall -Wno-unused -Wunused-value -Wunused-parameter" GMXC_CFLAGS)
GMX_TEST_CFLAG(CFLAGS_WARN_EXTRA "-Wextra -Wno-missing-field-initializers -Wno-sign-compare -Wpointer-arith" GMXC_CFLAGS)
+ # Since 4.8 on by default. For previous version disabling is a no-op. Only disabling for Release because with assert
+ # the warnings are OK.
+ GMX_TEST_CFLAG(CFLAGS_WARN_REL "-Wno-array-bounds" GMXC_CFLAGS_RELEASE_ONLY)
# new in gcc 4.5
GMX_TEST_CFLAG(CFLAGS_EXCESS_PREC "-fexcess-precision=fast" GMXC_CFLAGS_RELEASE)
GMX_TEST_CFLAG(CFLAGS_COPT "-fomit-frame-pointer -funroll-all-loops"
# Problematic with CUDA
# GMX_TEST_CXXFLAG(CXXFLAGS_WARN_EFFCXX "-Wnon-virtual-dtor" GMXC_CXXFLAGS)
GMX_TEST_CXXFLAG(CXXFLAGS_WARN_EXTRA "-Wextra -Wno-missing-field-initializers -Wpointer-arith" GMXC_CXXFLAGS)
+ GMX_TEST_CFLAG(CXXFLAGS_WARN_REL "-Wno-array-bounds" GMXC_CXXFLAGS_RELEASE_ONLY)
# new in gcc 4.5
GMX_TEST_CXXFLAG(CXXFLAGS_EXCESS_PREC "-fexcess-precision=fast" GMXC_CXXFLAGS_RELEASE)
GMX_TEST_CXXFLAG(CXXFLAGS_COPT "-fomit-frame-pointer -funroll-all-loops"
/* Box relative coordinates are stored for dimensions with pbc */
posA *= pbc->box[m][m];
posB *= pbc->box[m][m];
+ assert(npbcdim <= DIM);
for (d = m+1; d < npbcdim; d++)
{
posA += pos0A[d]*pbc->box[d][m];
clear_rvec(com_sc);
for (m = 0; m < npbcdim; m++)
{
+ assert(npbcdim <= DIM);
for (d = m; d < npbcdim; d++)
{
com_sc[m] += com[d]*pbc->box[d][m];
clear_rvec(comB_sc);
for (m = 0; m < npbcdim; m++)
{
+ assert(npbcdim <= DIM);
for (d = m; d < npbcdim; d++)
{
comA_sc[m] += comA[d]*pbc->box[d][m];
#endif
#include <math.h>
+#include <assert.h>
+
#include "sysstuff.h"
#include "typedefs.h"
#include "vec.h"
pbc->dim = i;
}
}
+ assert(pbc->dim < DIM);
for (i = 0; i < pbc->dim; i++)
{
if (pbc->box[pbc->dim][i] != 0)
#include <string.h>
#include <errno.h>
#include <limits.h>
+#include <assert.h>
#include "sysstuff.h"
#include "smalloc.h"
if (rc_scaling != erscNO)
{
+ assert(npbcdim <= DIM);
+
for (mb = 0; mb < mtop->nmolblock; mb++)
{
molb = &mtop->molblock[mb];
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include <ctype.h>
#include <math.h>
+#include <assert.h>
#include "sysstuff.h"
#include "smalloc.h"
/* When the B topology parameters are not set,
* copy them from topology A
*/
+ assert(nrfp <= 4);
for (i = n; i < nrfp; i++)
{
c[i] = c[i-2];
bFoundA = default_params(ftype, bondtype, at, atype, ¶m, FALSE, ¶m_defA, &nparam_defA);
if (bFoundA)
{
- /* Copy the A-state and B-state default parameters */
+ /* Copy the A-state and B-state default parameters. */
+ assert(NRFPA(ftype)+NRFPB(ftype) <= MAXFORCEPARAM);
for (j = 0; (j < NRFPA(ftype)+NRFPB(ftype)); j++)
{
param.c[j] = param_defA->c[j];
#include <config.h>
#endif
+#include <assert.h>
+
#include "copyrite.h"
#include "gromacs/math/utilities.h"
#include "macros.h"
c[0] += 180;
}
}
+ assert(nrfp <= MAXFORCEPARAM/2);
for (j = 0; (j < nrfp); j++)
{
plist->param[i].c[j] = c[j];
#include <math.h>
#include <string.h>
#include <stdlib.h>
+#include <assert.h>
+
#include "typedefs.h"
#include "smalloc.h"
#include "gmx_fatal.h"
corner[YY] -= corner[ZZ]*box[ZZ][YY]/box[ZZ][ZZ];
}
/* Apply the triclinic couplings */
+ assert(ddbox->npbcdim <= DIM);
for (i = YY; i < ddbox->npbcdim; i++)
{
for (j = XX; j < i; j++)