diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-04-30 12:06:59 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-04-30 12:07:04 +0200 |
commit | 01f8f17b67eb3ebbde5489eb6ee96d332e368d14 (patch) | |
tree | e1d18735fadbd6008283ff3486d1486b7c68f494 | |
parent | e619e0e4d458c347e4130821fc823afc6e21ade2 (diff) |
SCons: Disable `-Werror=return-type` for GCC 12+ due to regression
Works around and thus closes #58747.
Supersedes #60613.
-rw-r--r-- | SConstruct | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/SConstruct b/SConstruct index af01329933..1c9ef7d820 100644 --- a/SConstruct +++ b/SConstruct @@ -618,10 +618,14 @@ if selected_platform in platform_list: env.Append(CXXFLAGS=["-Wno-error=cpp"]) if cc_version_major == 7: # Bogus warning fixed in 8+. env.Append(CCFLAGS=["-Wno-error=strict-overflow"]) + if cc_version_major >= 12: # False positives in our error macros, see GH-58747. + env.Append(CCFLAGS=["-Wno-error=return-type"]) elif methods.using_clang(env) or methods.using_emcc(env): env.Append(CXXFLAGS=["-Wno-error=#warnings"]) - else: # always enable those errors - env.Append(CCFLAGS=["-Werror=return-type"]) + else: # Always enable those errors. + # False positives in our error macros, see GH-58747. + if not (methods.using_gcc(env) and cc_version_major >= 12): + env.Append(CCFLAGS=["-Werror=return-type"]) if hasattr(detect, "get_program_suffix"): suffix = "." + detect.get_program_suffix() |