@@ -19,7 +19,24 @@ function(add_compile_options_safe FLAG)
1919endfunction ()
2020
2121if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" )
22- add_compile_options (-Wall -Wextra -pedantic -Wcast-qual -Wfloat-equal -Wmissing-declarations -Wmissing-format-attribute -Wredundant-decls -Wshadow -Wundef -Wold-style-cast -Wno-multichar )
22+ add_compile_options (-pedantic )
23+ add_compile_options (-Wall )
24+ add_compile_options (-Wextra )
25+ add_compile_options (-Wcast-qual ) # Cast for removing type qualifiers
26+ add_compile_options (-Wfloat-equal ) # Floating values used in equality comparisons
27+ add_compile_options (-Wmissing-declarations ) # If a global function is defined without a previous declaration
28+ add_compile_options (-Wmissing-format-attribute ) #
29+ add_compile_options (-Wno-long-long )
30+ add_compile_options (-Wpacked ) #
31+ add_compile_options (-Wredundant-decls ) # if anything is declared more than once in the same scope
32+ add_compile_options (-Wundef )
33+ add_compile_options (-Wno-missing-braces )
34+ add_compile_options (-Wno-sign-compare )
35+ add_compile_options (-Wno-multichar )
36+ add_compile_options (-Woverloaded-virtual ) # when a function declaration hides virtual functions from a base class
37+
38+ add_compile_options (-Wsuggest-attribute=noreturn )
39+ add_compile_options_safe (-Wuseless-cast )
2340elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
2441 add_compile_definitions (_CRT_SECURE_NO_WARNINGS )
2542elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
0 commit comments