From d0a6ef1f5befc653a92dccc81bfb5e1abfd5e13a Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 25 Oct 2018 18:39:40 +0300 Subject: [PATCH] Disable maybe-uninitialized warning for GCC >= 7.0. GitOrigin-RevId: a8c6c74daabac2c77443fa652c94083127f799ae --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c01a9423e..d642da883 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -220,6 +220,10 @@ if (NOT MSVC) # add_cxx_compiler_flag("-Wzero-as-null-pointer-constant") endif() +if (GCC AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)) + add_cxx_compiler_flag("-Wno-maybe-uninitialized") # too much false positives +endif() + #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem /usr/include/c++/v1") #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread")