Add -Wmissing-variable-declarations to common warnings

This commit is contained in:
Martin Hořeňovský 2022-05-02 12:51:46 +02:00
parent 7752229105
commit d2cb934d28
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A
3 changed files with 3 additions and 2 deletions

View File

@ -64,6 +64,7 @@ function(add_warnings_to_targets targets)
"-Wmissing-braces"
"-Wmissing-declarations"
"-Wmissing-noreturn"
"-Wmissing-variable-declarations"
"-Wnull-dereference"
"-Wold-style-cast"
"-Woverloaded-virtual"

View File

@ -14,7 +14,7 @@
namespace Catch {
CATCH_INTERNAL_START_WARNINGS_SUPPRESSION
CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS
LeakDetector leakDetector;
static LeakDetector leakDetector;
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
}

View File

@ -33,7 +33,7 @@ struct foo {
#pragma clang diagnostic ignored "-Wglobal-constructors"
#endif
// Construct foo, but `foo::print` should not be run
foo f;
static foo f;
#if defined(__clang__)