|
@@ -422,17 +422,21 @@ if selected_platform in platform_list:
|
|
|
else: # GCC, Clang
|
|
|
version = methods.get_compiler_version(env) or [-1, -1]
|
|
|
|
|
|
- gcc_common_warnings = []
|
|
|
+ common_warnings = []
|
|
|
|
|
|
if methods.using_gcc(env):
|
|
|
- gcc_common_warnings += ["-Wno-misleading-indentation"]
|
|
|
+ common_warnings += ["-Wno-misleading-indentation"]
|
|
|
if version[0] >= 7:
|
|
|
- gcc_common_warnings += ["-Wshadow-local"]
|
|
|
+ common_warnings += ["-Wshadow-local"]
|
|
|
+ elif methods.using_clang(env):
|
|
|
+ # 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"]
|
|
|
|
|
|
if env["warnings"] == "extra":
|
|
|
# Note: enable -Wimplicit-fallthrough for Clang (already part of -Wextra for GCC)
|
|
|
# once we switch to C++11 or later (necessary for our FALLTHROUGH macro).
|
|
|
- env.Append(CCFLAGS=["-Wall", "-Wextra", "-Wwrite-strings", "-Wno-unused-parameter"] + gcc_common_warnings)
|
|
|
+ env.Append(CCFLAGS=["-Wall", "-Wextra", "-Wwrite-strings", "-Wno-unused-parameter"] + common_warnings)
|
|
|
env.Append(CXXFLAGS=["-Wctor-dtor-privacy", "-Wnon-virtual-dtor"])
|
|
|
if methods.using_gcc(env):
|
|
|
env.Append(
|
|
@@ -448,9 +452,9 @@ if selected_platform in platform_list:
|
|
|
if version[0] >= 9:
|
|
|
env.Append(CCFLAGS=["-Wattribute-alias=2"])
|
|
|
elif env["warnings"] == "all":
|
|
|
- env.Append(CCFLAGS=["-Wall"] + gcc_common_warnings)
|
|
|
+ env.Append(CCFLAGS=["-Wall"] + common_warnings)
|
|
|
elif env["warnings"] == "moderate":
|
|
|
- env.Append(CCFLAGS=["-Wall", "-Wno-unused"] + gcc_common_warnings)
|
|
|
+ env.Append(CCFLAGS=["-Wall", "-Wno-unused"] + common_warnings)
|
|
|
else: # 'no'
|
|
|
env.Append(CCFLAGS=["-w"])
|
|
|
|