-Wshadow только для GCC >= 4.8

This commit is contained in:
Andrei Astafev 2019-07-08 08:33:03 +03:00
parent 38d9326ce8
commit eabbde0701

View File

@ -84,7 +84,6 @@ if(CMAKE_CXX_COMPILER_IS_CLANG
check_enable_cxx_flag(-Wno-variadic-macros) check_enable_cxx_flag(-Wno-variadic-macros)
check_enable_cxx_flag(-Wno-parentheses) check_enable_cxx_flag(-Wno-parentheses)
check_enable_cxx_flag(-Wstrict-null-sentinel) check_enable_cxx_flag(-Wstrict-null-sentinel)
check_enable_cxx_flag(-Wshadow)
check_enable_cxx_flag(-Wshadow-all) check_enable_cxx_flag(-Wshadow-all)
endif() endif()
@ -111,6 +110,10 @@ if(CMAKE_CXX_COMPILER_IS_GCC)
# Let's just disable the warning for now. # Let's just disable the warning for now.
check_enable_cxx_flag(-Wno-attributes) check_enable_cxx_flag(-Wno-attributes)
endif() endif()
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.799")
# -Wshadow gives a lot of false positives with GCC 4.7.2 in Astra Linux 1.5
check_enable_cxx_flag(-Wshadow)
endif()
endif() endif()
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "e2k") if(CMAKE_SYSTEM_PROCESSOR STREQUAL "e2k")