From: Arnaud Giersch Date: Wed, 18 Jan 2012 14:21:39 +0000 (+0100) Subject: Don't turn warnings about clobbered variables into errors on older gcc. X-Git-Tag: exp_20120216~119^2~73 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/06ede6a203ee04c497bb46f1ce1c86f0aaab81be?ds=sidebyside Don't turn warnings about clobbered variables into errors on older gcc. Rationale: given warnings seem bogus. --- diff --git a/buildtools/Cmake/Flags.cmake b/buildtools/Cmake/Flags.cmake index c954d2ed62..a87ec9ed82 100644 --- a/buildtools/Cmake/Flags.cmake +++ b/buildtools/Cmake/Flags.cmake @@ -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)