From 872ab6b1e74ea5656ea8bd8dff7235e4c468b36f Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Mon, 7 Jan 2019 17:59:26 +0100 Subject: [PATCH] Don't turn gcc's -Wmaybe-uninitialized into an error. 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/cmake/GCCFlags.cmake b/tools/cmake/GCCFlags.cmake index 3417e4bc92..de2b848e4e 100644 --- a/tools/cmake/GCCFlags.cmake +++ b/tools/cmake/GCCFlags.cmake @@ -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 -- 2.20.1