mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 07:53:26 +00:00
SCons: Don't enable -Wenum-conversion
for GCC < 11
This warning was introduced in GCC 10 but only for C/Obj-C. In GCC 11 it seems to have been made compatible with C++. Also restrict -Wno-return-type to GCC 12, that regression was fixed in GCC 13.
This commit is contained in:
parent
1a1cc0f7b0
commit
f09ffeedd0
1 changed files with 6 additions and 3 deletions
|
@ -891,21 +891,24 @@ if env.msvc and not methods.using_clang(env): # MSVC
|
|||
env.AppendUnique(LINKFLAGS=["/WX"])
|
||||
|
||||
else: # GCC, Clang
|
||||
common_warnings = ["-Wenum-conversion"]
|
||||
|
||||
common_warnings = []
|
||||
if methods.using_gcc(env):
|
||||
common_warnings += ["-Wshadow", "-Wno-misleading-indentation"]
|
||||
if cc_version_major < 11:
|
||||
# Regression in GCC 9/10, spams so much in our variadic templates
|
||||
# that we need to outright disable it.
|
||||
common_warnings += ["-Wno-type-limits"]
|
||||
if cc_version_major >= 12: # False positives in our error macros, see GH-58747.
|
||||
if cc_version_major == 12:
|
||||
# Regression in GCC 12, false positives in our error macros, see GH-58747.
|
||||
common_warnings += ["-Wno-return-type"]
|
||||
if cc_version_major >= 11:
|
||||
common_warnings += ["-Wenum-conversion"]
|
||||
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"]
|
||||
common_warnings += ["-Wenum-conversion"]
|
||||
|
||||
# clang-cl will interpret `-Wall` as `-Weverything`, workaround with compatibility cast.
|
||||
env["WARNLEVEL"] = "-Wall" if not env.msvc else "-W3"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue