Enable a bunch of extra warnings

This commit is contained in:
Martin Hořeňovský 2022-05-01 23:15:24 +02:00
parent 198808a24e
commit 722c197855
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A

View File

@ -48,17 +48,25 @@ function(add_warnings_to_targets targets)
"-Wcall-to-pure-virtual-from-ctor-dtor" "-Wcall-to-pure-virtual-from-ctor-dtor"
"-Wcast-align" "-Wcast-align"
"-Wcatch-value" "-Wcatch-value"
"-Wdangling"
"-Wdeprecated" "-Wdeprecated"
"-Wdeprecated-register" "-Wdeprecated-register"
"-Wexceptions"
"-Wexit-time-destructors" "-Wexit-time-destructors"
"-Wextra" "-Wextra"
"-Wextra-semi" "-Wextra-semi"
"-Wglobal-constructors" "-Wglobal-constructors"
"-Winit-self"
"-Wmisleading-indentation" "-Wmisleading-indentation"
"-Wmismatched-new-delete"
"-Wmismatched-return-types"
"-Wmismatched-tags"
"-Wmissing-braces" "-Wmissing-braces"
"-Wmissing-declarations" "-Wmissing-declarations"
"-Wmissing-noreturn" "-Wmissing-noreturn"
"-Wnull-dereference"
"-Wold-style-cast" "-Wold-style-cast"
"-Woverloaded-virtual"
"-Wparentheses" "-Wparentheses"
"-Wpedantic" "-Wpedantic"
"-Wreorder" "-Wreorder"
@ -67,12 +75,21 @@ function(add_warnings_to_targets targets)
"-Wstrict-aliasing" "-Wstrict-aliasing"
"-Wsuggest-override" "-Wsuggest-override"
"-Wundef" "-Wundef"
"-Wuninitialized"
"-Wunneeded-internal-declaration"
"-Wunreachable-code" "-Wunreachable-code"
"-Wunused" "-Wunused"
"-Wunused-function" "-Wunused-function"
"-Wunused-parameter" "-Wunused-parameter"
"-Wvla" "-Wvla"
"-Wweak-vtables" "-Wweak-vtables"
# This is a useful warning, but our tests sometimes rely on
# functions being present, but not picked (e.g. various checks
# for stringification implementation ordering).
# Ergo, we should use it every now and then, but we cannot
# enable it by default.
# "-Wunused-member-function"
) )
foreach(warning ${CHECKED_WARNING_FLAGS}) foreach(warning ${CHECKED_WARNING_FLAGS})
add_cxx_flag_if_supported_to_targets(${warning} "${targets}") add_cxx_flag_if_supported_to_targets(${warning} "${targets}")