File tree Expand file tree Collapse file tree 2 files changed +21
-4
lines changed
Expand file tree Collapse file tree 2 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -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" )
Original file line number Diff line number Diff line change @@ -279,9 +279,9 @@ static void characterLiteral()
279279
280280#ifdef __GNUC__
281281 // BEGIN Implementation-specific results
282- ASSERT_EQUALS (static_cast < int >( ' AB' ) , simplecpp::characterLiteralToLL (" 'AB'" ));
283- ASSERT_EQUALS (static_cast < int >( ' ABC' ) , simplecpp::characterLiteralToLL (" 'ABC'" ));
284- ASSERT_EQUALS (static_cast < int >( ' ABCD' ) , simplecpp::characterLiteralToLL (" 'ABCD'" ));
282+ ASSERT_EQUALS (' AB' , simplecpp::characterLiteralToLL (" 'AB'" ));
283+ ASSERT_EQUALS (' ABC' , simplecpp::characterLiteralToLL (" 'ABC'" ));
284+ ASSERT_EQUALS (' ABCD' , simplecpp::characterLiteralToLL (" 'ABCD'" ));
285285 ASSERT_EQUALS (' \134 t' , simplecpp::characterLiteralToLL (" '\\ 134t'" )); // cppcheck ticket #7452
286286 // END Implementation-specific results
287287#endif
You can’t perform that action at this time.
0 commit comments