making the warning gods happy again...
diff --git a/scripts/cmake/common.cmake b/scripts/cmake/common.cmake
index 4d7e826..b2459e7 100644
--- a/scripts/cmake/common.cmake
+++ b/scripts/cmake/common.cmake
@@ -79,7 +79,7 @@
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
- add_compiler_flags(-Wno-unknown-pragmas)
+ #add_compiler_flags(-Wno-unknown-pragmas)
add_compiler_flags(-Wall)
add_compiler_flags(-Wextra)
add_compiler_flags(-fdiagnostics-show-option)
@@ -113,33 +113,49 @@
add_compiler_flags(-Wunused-but-set-variable)
add_compiler_flags(-Wunused-result)
add_compiler_flags(-Wsuggest-override)
- add_compiler_flags(-Wdouble-promotion)
- add_compiler_flags(-Wtrampolines)
- add_compiler_flags(-Wzero-as-null-pointer-constant)
- add_compiler_flags(-Wuseless-cast)
- add_compiler_flags(-Wnoexcept)
- add_compiler_flags(-Wvector-operation-performance)
- add_compiler_flags(-Wshift-overflow=2)
- add_compiler_flags(-Wnull-dereference)
- add_compiler_flags(-Wduplicated-cond)
- add_compiler_flags(-Walloc-zero)
- add_compiler_flags(-Walloca)
- add_compiler_flags(-Wduplicated-branches)
- add_compiler_flags(-Wcast-align=strict)
- add_compiler_flags(-Wsuggest-attribute=cold)
- add_compiler_flags(-Wsuggest-attribute=const)
- add_compiler_flags(-Wsuggest-attribute=format)
- add_compiler_flags(-Wsuggest-attribute=malloc)
- add_compiler_flags(-Wsuggest-attribute=noreturn)
- add_compiler_flags(-Wsuggest-attribute=pure)
- add_compiler_flags(-Wsuggest-final-methods)
- add_compiler_flags(-Wsuggest-final-types)
+
+ # add_compiler_flags(-Wsuggest-attribute=cold)
+ # add_compiler_flags(-Wsuggest-attribute=const)
+ # add_compiler_flags(-Wsuggest-attribute=format)
+ # add_compiler_flags(-Wsuggest-attribute=malloc)
+ # add_compiler_flags(-Wsuggest-attribute=noreturn)
+ # add_compiler_flags(-Wsuggest-attribute=pure)
+ # add_compiler_flags(-Wsuggest-final-methods)
+ # add_compiler_flags(-Wsuggest-final-types)
+
+ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6)
+ add_compiler_flags(-Wnoexcept)
+ endif()
# no way to silence it in the expression decomposition macros: _Pragma() in macros doesn't work for the c++ front-end of g++
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55578
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69543
# Also the warning is completely worthless nowadays - http://stackoverflow.com/questions/14016993
#add_compiler_flags(-Waggregate-return)
+
+ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
+ add_compiler_flags(-Wdouble-promotion)
+ add_compiler_flags(-Wtrampolines)
+ add_compiler_flags(-Wzero-as-null-pointer-constant)
+ add_compiler_flags(-Wuseless-cast)
+ add_compiler_flags(-Wvector-operation-performance)
+ endif()
+
+ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0)
+ add_compiler_flags(-Wshift-overflow=2)
+ add_compiler_flags(-Wnull-dereference)
+ add_compiler_flags(-Wduplicated-cond)
+ endif()
+
+ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
+ add_compiler_flags(-Walloc-zero)
+ add_compiler_flags(-Walloca)
+ add_compiler_flags(-Wduplicated-branches)
+ endif()
+
+ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
+ add_compiler_flags(-Wcast-align=strict)
+ endif()
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")