Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't turn gcc's -Wmaybe-uninitialized into an error.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 7 Jan 2019 16:59:26 +0000 (17:59 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 7 Jan 2019 16:59:26 +0000 (17:59 +0100)
It is sometimes bogus. For example:
  src/include/xbt/parmap.hpp:225:19: error:  may be used uninitialized in this function [-Werror=maybe-uninitialized]
      return boost::none;
                    ^

tools/cmake/GCCFlags.cmake

index 3417e4b..de2b848 100644 (file)
@@ -19,7 +19,7 @@ if(enable_compile_warnings)
     set(warnCFLAGS "${warnCFLAGS} -Wformat-signedness")
   endif()
   if(CMAKE_COMPILER_IS_GNUCC)
-    set(warnCFLAGS "${warnCFLAGS} -Wclobbered -Wno-error=clobbered  -Wno-unused-local-typedefs -Wno-error=attributes")
+    set(warnCFLAGS "${warnCFLAGS} -Wclobbered -Wno-error=clobbered  -Wno-unused-local-typedefs -Wno-error=attributes -Wno-error=maybe-uninitialized")
   endif()
   if (CMAKE_CXX_COMPILER_ID MATCHES "Intel")
     # ignore remark  #1418: external function definition with no prior declaration
@@ -34,7 +34,7 @@ if(enable_compile_warnings)
     set(warnCFLAGS "${warnCFLAGS} -Wformat-signedness")
   endif()
   if(CMAKE_COMPILER_IS_GNUCXX)
-    set(warnCXXFLAGS "${warnCXXFLAGS} -Wclobbered -Wno-error=clobbered  -Wno-unused-local-typedefs -Wno-error=attributes")
+    set(warnCXXFLAGS "${warnCXXFLAGS} -Wclobbered -Wno-error=clobbered  -Wno-unused-local-typedefs -Wno-error=attributes -Wno-error=maybe-uninitialized")
   endif()
   if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
     # don't care about class that become struct, avoid issue of empty C structs