diff options
author | Ninni Pipping <over999ships@gmail.com> | 2023-05-11 12:32:23 +0200 |
---|---|---|
committer | RĂ©mi Verschelde <rverschelde@gmail.com> | 2023-05-12 13:56:48 +0200 |
commit | f93a4287cf833134020e5b35c4b800c2edff1b94 (patch) | |
tree | a902c82bc0039af8f8a403105682427fcab0bad1 /SConstruct | |
parent | 09c5a8fe496217f408fea27a470ac8f990f3b20b (diff) |
Enable shadow warnings and fix raised errors
(cherry picked from commit 71ee65dc5701a0675ae6b1879a694a28c7206a63)
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/SConstruct b/SConstruct index cb4bf95467..403304f49f 100644 --- a/SConstruct +++ b/SConstruct @@ -686,7 +686,8 @@ if selected_platform in platform_list: if env["warnings"] == "extra": env.Append(CCFLAGS=["/W4"]) elif env["warnings"] == "all": - env.Append(CCFLAGS=["/W3"]) + # C4458 is like -Wshadow. Part of /W4 but let's apply it for the default /W3 too. + env.Append(CCFLAGS=["/W3", "/w34458"]) elif env["warnings"] == "moderate": env.Append(CCFLAGS=["/W2"]) # Disable warnings which we don't plan to fix. @@ -715,7 +716,7 @@ if selected_platform in platform_list: common_warnings = [] if methods.using_gcc(env): - common_warnings += ["-Wshadow-local", "-Wno-misleading-indentation"] + common_warnings += ["-Wshadow", "-Wno-misleading-indentation"] if cc_version_major == 7: # Bogus warning fixed in 8+. common_warnings += ["-Wno-strict-overflow"] if cc_version_major < 11: @@ -725,6 +726,7 @@ if selected_platform in platform_list: if cc_version_major >= 12: # False positives in our error macros, see GH-58747. common_warnings += ["-Wno-return-type"] elif methods.using_clang(env) or methods.using_emcc(env): + common_warnings += ["-Wshadow-field-in-constructor", "-Wshadow-uncaptured-local"] # We often implement `operator<` for structs of pointers as a requirement # for putting them in `Set` or `Map`. We don't mind about unreliable ordering. common_warnings += ["-Wno-ordered-compare-function-pointers"] |