"-Wno-covered-switch-default" #GCC gives maybe-uninitialized without default label and checks for illegal enum values.
"-Wno-switch-enum" # default statement for enum is OK
+ # TODO uncomment the next few ignore lines when we upgrade to test with clang 8 in Jenkins
+
+ # The barriers we use for tMPI and Nbnxm are sufficient, but it's
+ # not known whether they're excessive. We assume they not
+ # excessive.
+ # "-Wno-atomic-implicit-seq-cst"
+
+ # We need to use macros like
+ # GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR. Those will look strange
+ # if they don't have a semicolon after them, and might confuse
+ # tools like IDEs also.
+ # "-Wno-extra-semi-stmt"
+
#Following ones are undecided/TODO
"-Wno-disabled-macro-expansion"
"-Wno-cast-align"
gmx_manage_lmfit()
target_link_libraries(libgromacs PRIVATE lmfit)
-if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION MATCHES "^6\.0")
+# Fix everything found by the latest version of clang that we use in
+# Jenkins testing. This should be updated when we update the latest
+# tested version of clang.
+if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION MATCHES "^7\.0")
target_compile_options(libgromacs PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-Weverything ${IGNORED_CLANG_ALL_WARNINGS}>)
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, 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.
/* Assume input x is sorted */
for (nbegin = 0; (nbegin < nx) && (x[nbegin] <= tbegin); nbegin++)
{
- ;
+ // Deliberately left empty
}
if ((nbegin == nx) || (nbegin == 0))
{
rvec com; /* center of mass */
rvec r; /* distance of atoms to center of mass */
double **inten;
- double dd[DIM], **ev, tmp;
+ double dd[DIM], **ev;
snew(inten, DIM);
snew(ev, DIM);
* At the moment I have no idea how this will work out for other molecules...
*/
-#define SWAP(i) \
- if (dd[(i)+1] > dd[i]) { \
- tmp = dd[i]; \
- dd[i] = dd[(i)+1]; \
- dd[(i)+1] = tmp; \
+ if (dd[1] > dd[0])
+ {
+ std::swap(dd[0], dd[1]);
+ }
+ if (dd[2] > dd[1])
+ {
+ std::swap(dd[1], dd[2]);
+ }
+ if (dd[1] > dd[0])
+ {
+ std::swap(dd[0], dd[1]);
}
- SWAP(0);
- SWAP(1);
- SWAP(0);
for (m = 0; (m < DIM); m++)
{
* code. Once many of them have become modules, we should change this
* approach.
*
- * Note that the presence of const reference members means that the
- * default constructor would be implicitly deleted. But we only want
- * to make one of these when we know how to initialize these members,
- * so that is perfect. To ensure this remains true even if we would
- * remove those members, we explicitly delete this constructor.
- * Other constructors, copies and moves are OK. */
+ * Use a braced initializer list to construct one of these. */
struct Integrator
{
//! Handles logging.
/*! \brief Function to run the correct IntegratorFunctionType,
* based on the .mdp integrator field. */
void run(unsigned int ei, bool doRerun);
- //! We only intend to construct such objects with an initializer list.
- Integrator() = delete;
};
} // namespace gmx
* updated, then the member will be value initialized, which will
* typically mean initialization to zero.
*
- * We only want to construct one of these with an initializer list, so
- * we explicitly delete the default constructor. */
+ * Use a braced initializer list to construct one of these. */
class EnergyEvaluator
{
public:
- //! We only intend to construct such objects with an initializer list.
- EnergyEvaluator() = delete;
/*! \brief Evaluates an energy on the state in \c ems.
*
* \todo In practice, the same objects mu_tot, vir, and pres
* The minor index of the array goes over both the LJ combination rules,
* which is only supported by plain cut-off, and the LJ switch/PME functions.
*/
-p_nbk_func_noener nbnxm_kernel_noener_simd_{1}[coulktNR][vdwktNR] =
+static p_nbk_func_noener nbnxm_kernel_noener_simd_{1}[coulktNR][vdwktNR] =
{2}
-p_nbk_func_ener nbnxm_kernel_ener_simd_{1}[coulktNR][vdwktNR] =
+static p_nbk_func_ener nbnxm_kernel_ener_simd_{1}[coulktNR][vdwktNR] =
{3}
-p_nbk_func_ener nbnxm_kernel_energrp_simd_{1}[coulktNR][vdwktNR] =
+static p_nbk_func_ener nbnxm_kernel_energrp_simd_{1}[coulktNR][vdwktNR] =
{4}
#endif /* INCLUDE_KERNELFUNCTION_TABLES */
* The minor index of the array goes over both the LJ combination rules,
* which is only supported by plain cut-off, and the LJ switch/PME functions.
*/
-p_nbk_func_noener nbnxm_kernel_noener_simd_2xmm[coulktNR][vdwktNR] =
+static p_nbk_func_noener nbnxm_kernel_noener_simd_2xmm[coulktNR][vdwktNR] =
{
{
nbnxm_kernel_ElecRF_VdwLJCombGeom_F_2xmm,
},
};
-p_nbk_func_ener nbnxm_kernel_ener_simd_2xmm[coulktNR][vdwktNR] =
+static p_nbk_func_ener nbnxm_kernel_ener_simd_2xmm[coulktNR][vdwktNR] =
{
{
nbnxm_kernel_ElecRF_VdwLJCombGeom_VF_2xmm,
},
};
-p_nbk_func_ener nbnxm_kernel_energrp_simd_2xmm[coulktNR][vdwktNR] =
+static p_nbk_func_ener nbnxm_kernel_energrp_simd_2xmm[coulktNR][vdwktNR] =
{
{
nbnxm_kernel_ElecRF_VdwLJCombGeom_VgrpF_2xmm,
* The minor index of the array goes over both the LJ combination rules,
* which is only supported by plain cut-off, and the LJ switch/PME functions.
*/
-p_nbk_func_noener nbnxm_kernel_noener_simd_4xm[coulktNR][vdwktNR] =
+static p_nbk_func_noener nbnxm_kernel_noener_simd_4xm[coulktNR][vdwktNR] =
{
{
nbnxm_kernel_ElecRF_VdwLJCombGeom_F_4xm,
},
};
-p_nbk_func_ener nbnxm_kernel_ener_simd_4xm[coulktNR][vdwktNR] =
+static p_nbk_func_ener nbnxm_kernel_ener_simd_4xm[coulktNR][vdwktNR] =
{
{
nbnxm_kernel_ElecRF_VdwLJCombGeom_VF_4xm,
},
};
-p_nbk_func_ener nbnxm_kernel_energrp_simd_4xm[coulktNR][vdwktNR] =
+static p_nbk_func_ener nbnxm_kernel_energrp_simd_4xm[coulktNR][vdwktNR] =
{
{
nbnxm_kernel_ElecRF_VdwLJCombGeom_VgrpF_4xm,