diff options
author | marxin <mliska@suse.cz> | 2019-02-12 21:10:08 +0100 |
---|---|---|
committer | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-02-20 19:44:12 +0100 |
commit | 8d51618949d5ea8a94e0f504401e8f852a393968 (patch) | |
tree | 6c0ab829b02aba47ff3dc27b9a14d3c3a0658a3b /SConstruct | |
parent | 132e2f458df7a3551a251d68afeccd0362ca6be2 (diff) |
Add -Wshadow=local to warnings and fix reported issues.
Fixes #25316.
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/SConstruct b/SConstruct index 2c79665465..3734268cae 100644 --- a/SConstruct +++ b/SConstruct @@ -336,12 +336,18 @@ if selected_platform in platform_list: env.Append(CCFLAGS=['/WX']) else: # Rest of the world disable_nonessential_warnings = ['-Wno-sign-compare'] + shadow_local_warning = [] + + if 'gcc' in os.path.basename(env["CC"]): + version = methods.get_compiler_version(env) + if version != None and version[0] >= '7': + shadow_local_warning = ['-Wshadow-local'] if (env["warnings"] == 'extra'): - env.Append(CCFLAGS=['-Wall', '-Wextra']) + env.Append(CCFLAGS=['-Wall', '-Wextra'] + shadow_local_warning) elif (env["warnings"] == 'all'): - env.Append(CCFLAGS=['-Wall'] + disable_nonessential_warnings) + env.Append(CCFLAGS=['-Wall'] + shadow_local_warning + disable_nonessential_warnings) elif (env["warnings"] == 'moderate'): - env.Append(CCFLAGS=['-Wall', '-Wno-unused'] + disable_nonessential_warnings) + env.Append(CCFLAGS=['-Wall', '-Wno-unused'] + shadow_local_warning + disable_nonessential_warnings) else: # 'no' env.Append(CCFLAGS=['-w']) if (env["werror"]): |