@@ -9,31 +9,25 @@ if (MSVC)
99 # > extremely noisy and low-value warnings. In general, the STL does not attempt to be `/Wall` clean.
1010 string (REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} " ) # add_compile_options(/W4)
1111
12- elseif (UNIX )
12+ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
1313 # https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
1414 #add_compile_options(-Werror) # Make all warnings into errors
15- add_compile_options (-Wall -Wextra -Wpedantic -pedantic-errors -Wunused )
16-
17- add_compile_options (-Wzero-as-null-pointer-constant )
18- #add_compile_options(-Wsuggest-final-types -Wsuggest-final-methods)
19- add_compile_options (-Wsuggest-override )
20- add_compile_options (-Woverloaded-virtual )
21- #add_compile_options(-Warray-bounds)
22- add_compile_options (-Wduplicated-branches -Wduplicated-cond )
23- add_compile_options (-Wtrampolines )
24- add_compile_options (-Wshadow )
25- #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wold-style-cast")
26- #add_compile_options(-Wfloat-equal)
27- #add_compile_options(-Wconversion)
28- #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weffc++")
29-
30- add_compile_options (-Wno-double-promotion ) # implicit conversion of `float` to `double` is fine
31-
32- add_compile_options (-Wno-array-bounds ) # TODO: fix the code!
33- add_compile_options (-Wno-maybe-uninitialized ) # TODO: fix the code!
34-
35- # Need a newer compiler than GCC 9
36- #add_compile_options(-Wnrvo)
15+ add_compile_options (-Wall -Wextra -Wpedantic -pedantic-errors -Wunused
16+ -Wzero-as-null-pointer-constant
17+ -Wsuggest-final-types -Wsuggest-final-methods
18+ -Wsuggest-override
19+ -Woverloaded-virtual
20+ -Warray-bounds
21+ -Wduplicated-branches -Wduplicated-cond
22+ -Wtrampolines
23+ -Wshadow
24+ -Wold-style-cast
25+ -Wfloat-equal
26+ -Wconversion
27+ -Weffc++
28+ # Need a newer compiler than GCC 9
29+ #-Wnrvo
30+ )
3731endif ()
3832
3933# add an interface library for unittests
0 commit comments