Fix warnings on llvm 11 compilers
authorErik Lindahl <erik.lindahl@gmail.com>
Mon, 25 May 2020 20:09:30 +0000 (20:09 +0000)
committerMark Abraham <mark.j.abraham@gmail.com>
Mon, 25 May 2020 20:09:30 +0000 (20:09 +0000)
This fixes a bunch of benign warnings exposed by recent
Intel compilers based on the llvm master branch frontend.

- Remove an unused mutex
- Use the C++ compiler for gmx_simdcall CMake tests
- Avoid anonymous structs to (C/C++ compatibility warning)

cmake/gmxManageSimd.cmake
src/gromacs/domdec/domdec_internal.h
src/gromacs/domdec/domdec_struct.h
src/gromacs/gmxana/gmx_wham.cpp
src/gromacs/mdrun/minimize.cpp
src/gromacs/nbnxm/pairlist.h
src/gromacs/selection/sm_insolidangle.cpp
src/gromacs/selection/sm_merge.cpp
src/gromacs/selection/sm_permute.cpp
src/gromacs/utility/fatalerror.cpp

index 55c49b921f19c1a21ea8b327d7cb55c9c9edf169..8109daa68c6962da758207af8222cbf64ec65d46 100644 (file)
@@ -397,7 +397,7 @@ if(NOT DEFINED GMX_SIMD_CALLING_CONVENTION)
         # ignored (e.g. clang on ARM), and in such cases we want this
         # check to lead to using no attribute in subsequent GROMACS
         # compilation, to avoid issuing the warning for lots of files.
-        check_c_source_compiles("
+        check_cxx_source_compiles("
 #pragma GCC diagnostic error \"-Wignored-attributes\"
 int ${callconv} f(int i) {return i;} int main(void) {return f(0);}
 " ${callconv_compile_var})
index 151e544adca0f4d834013d4584518769991144a1..7bee8f819857e1ea3d10c6c48a04b9573ccedc47 100644 (file)
@@ -145,7 +145,7 @@ struct DDCellsizesWithDlb
  * Here floats are accurate enough, since these variables
  * only influence the load balancing, not the actual MD results.
  */
-typedef struct
+typedef struct domdec_load
 {
     /**< The number of load recordings */
     int nload = 0;
@@ -168,7 +168,7 @@ typedef struct
 } domdec_load_t;
 
 /*! \brief Data needed to sort an atom to the desired location in the local state */
-typedef struct
+typedef struct gmx_cgsort
 {
     /**< Neighborsearch grid cell index */
     int nsc = 0;
@@ -179,7 +179,7 @@ typedef struct
 } gmx_cgsort_t;
 
 /*! \brief Temporary buffers for sorting atoms */
-typedef struct
+typedef struct gmx_domdec_sort
 {
     /**< Sorted array of indices */
     std::vector<gmx_cgsort_t> sorted;
@@ -284,7 +284,7 @@ enum class DlbState
 };
 
 /*! \brief The PME domain decomposition for one dimension */
-typedef struct
+typedef struct gmx_ddpme
 {
     /**< The dimension */
     int dim = 0;
index 8670ca81c6fc246c4ee9c84f5ca36a103baa63fd..f247c4bb8c19b22c4ee12fd9411115bf19a4b3a3 100644 (file)
@@ -99,7 +99,7 @@ struct DDPairInteractionRanges
     gmx::IVec shift1 = { 0, 0, 0 };
 };
 
-typedef struct
+typedef struct gmx_domdec_zone_size
 {
     /* Zone lower corner in triclinic coordinates         */
     gmx::RVec x0 = { 0, 0, 0 };
index 11093caedbd5c159b02de7a9a826248095684c40..9162bbcd4e261732652a3293f19cd3f69ff4be6f 100644 (file)
@@ -224,7 +224,7 @@ typedef struct
 } t_coordselection;
 
 //! Parameters of WHAM
-typedef struct // NOLINT(clang-analyzer-optin.performance.Padding)
+typedef struct UmbrellaOptions // NOLINT(clang-analyzer-optin.performance.Padding)
 {
     /*!
      * \name Input stuff
index dc2658f1d3290c87490f879901b8ef446da25c47..dca17d597de6c8a2f50729f16036fdb3af87441f 100644 (file)
@@ -117,7 +117,7 @@ using gmx::RVec;
 using gmx::VirtualSitesHandler;
 
 //! Utility structure for manipulating states during EM
-typedef struct
+typedef struct em_state
 {
     //! Copy of the global state
     t_state s;
index 04f33159905bdc48ef3400306e01ba907f826352..923a40082da885e445f8ee39f81840ac256ed8af 100644 (file)
@@ -171,7 +171,7 @@ struct nbnxn_ci_t
 };
 
 //! Grouped pair-list i-unit
-typedef struct
+typedef struct nbnxn_sci
 {
     //! Returns the number of j-cluster groups in this entry
     int numJClusterGroups() const { return cj4_ind_end - cj4_ind_start; }
index 70c0862d3610ce267e68f1d99bb239c57856460c..d649a874a4f396552de2a8aebf8588eba700ecb8 100644 (file)
@@ -164,7 +164,7 @@ typedef struct
  *
  * \ingroup module_selection
  */
-typedef struct
+typedef struct partition
 {
     /** Number of partition items (\p p contains \p n+1 items). */
     int n;
@@ -182,7 +182,7 @@ typedef struct
  *
  * \ingroup module_selection
  */
-typedef struct
+typedef struct spheresurfacebin
 {
     /** Number of points in the array \p x, -1 if whole bin covered. */
     int n;
@@ -200,7 +200,7 @@ typedef struct
  *
  * \ingroup module_selection
  */
-typedef struct
+typedef struct methoddata_insolidangle
 {
     /** Center of the solid angle. */
     gmx_ana_pos_t center;
index 5e7539a88f60be88b7326e9a5705807025e9bee8..1bf833e32a336465ef1a048a77bf7a41d148caec 100644 (file)
@@ -56,7 +56,7 @@
 /*! \internal \brief
  * Data structure for the merging selection modifiers.
  */
-typedef struct
+typedef struct methoddata_merge
 {
     /** Input positions. */
     gmx_ana_pos_t p1;
index 6ebde259dd93641b67c0e8b8f92085eea0e3211f..f8a4e8c17518bc7bbf677bf4bbd2365c9746ab17 100644 (file)
@@ -56,7 +56,7 @@
 /*! \internal \brief
  * Data structure for the \p permute selection modifier.
  */
-typedef struct
+typedef struct methoddata_permute
 {
     /** Positions to permute. */
     gmx_ana_pos_t p;
index b345a73407ea060aac8d90cf9ce81c36039d6c8f..04127783fd14ecc1f5e2f9346ceee5e5a5aecee4 100644 (file)
@@ -65,8 +65,7 @@
 
 #include "errorformat.h"
 
-static bool       bDebug = false;
-static gmx::Mutex where_mutex;
+static bool bDebug = false;
 
 FILE*    debug        = nullptr;
 gmx_bool gmx_debug_at = FALSE;