Minimal support for Clang
authorRoland Schulz <roland@utk.edu>
Sat, 3 Mar 2012 20:16:03 +0000 (15:16 -0500)
committerRoland Schulz <roland@utk.edu>
Sun, 4 Mar 2012 00:40:46 +0000 (19:40 -0500)
Change-Id: I4c6fb22ef8b5d596527eb8fe0991c3c573be606c

cmake/gmxCFlags.cmake
src/tools/gmx_clustsize.c

index 8e41dfd0226ac7ab28b79e472ac0ae49a5de2000..1a57f3a810d610f3935cb5c4567c038b4e14a672 100644 (file)
@@ -112,6 +112,19 @@ MACRO(gmx_c_flags)
         GMX_TEST_CFLAG(CXXFLAGS_WARN "/wd4273" GMXC_CXXFLAGS)
     endif()
 
+    if (CMAKE_C_COMPILER_ID MATCHES "Clang")
+        if(NOT GMX_OPENMP)
+            GMX_TEST_CFLAG(CFLAGS_PRAGMA "-Wno-unknown-pragmas" GMXC_CFLAGS)
+        endif()
+        GMX_TEST_CFLAG(CFLAGS_WARN "-Wall -Wno-unused" GMXC_CFLAGS)
+    endif()
+
+    if (CMAKE_C_COMPILER_ID MATCHES "Clang")
+        if(NOT GMX_OPENMP)
+            GMX_TEST_CFLAG(CXXFLAGS_PRAGMA "-Wno-unknown-pragmas" GMXC_CXXFLAGS)
+        endif()
+        GMX_TEST_CXXFLAG(CXXFLAGS_WARN "-Wall -Wno-unused" GMXC_CXXFLAGS)
+    endif()
 
     # now actually set the flags:
     # C
index 8ad5681cd76faa1b7be3464eec02188b45e03c48..f0ff0b3633ce76d2db010738942b53136c254ed9 100644 (file)
@@ -208,7 +208,7 @@ static void clust_size(const char *ndx,const char *trx,const char *xpm,
               * cluster cj and if so, put them in ci
               */
              for(k=0; (k<nindex); k++) {
-               if ((clust_index[k] == cj)) {
+               if (clust_index[k] == cj) {
                  if (clust_size[cj] <= 0)
                    gmx_fatal(FARGS,"negative cluster size %d for element %d",
                                clust_size[cj],cj);