Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't turn warnings about clobbered variables into errors on older gcc.
[simgrid.git] / buildtools / Cmake / Flags.cmake
index c954d2e..a87ec9e 100644 (file)
@@ -10,9 +10,11 @@ else(NOT __VISUALC__ AND NOT __BORLANDC__)
 endif(NOT __VISUALC__ AND NOT __BORLANDC__)
 
 if(enable_compile_warnings)
-       set(warnCFLAGS "-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Werror=clobbered -Wno-unused-function -Wno-unused-parameter -Wno-strict-aliasing -Wno-format-nonliteral -Werror ")
+     set(warnCFLAGS "-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wclobbered -Wno-unused-function -Wno-unused-parameter -Wno-strict-aliasing -Wno-format-nonliteral -Werror ")
     if(COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.5")
         set(warnCFLAGS "${warnCFLAGS} -Wno-error=unused-but-set-variable ")
+    else(COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.5")
+        set(warnCFLAGS "${warnCFLAGS} -Wno-error=clobbered ")
     endif(COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.5")
 endif(enable_compile_warnings)