From 9cbc3f14198c30c14315cabf72b0e3e3438b2f61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Mon, 26 Aug 2024 12:33:19 +0200 Subject: [PATCH] Change warning muting so it affects all levels, but locally --- SConstruct | 2 +- core/os/safe_binary_mutex.h | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 569ee24d850..94574aacb22 100644 --- a/SConstruct +++ b/SConstruct @@ -861,7 +861,7 @@ else: # GCC, Clang if cc_version_major >= 11: # Broke on MethodBind templates before GCC 11. env.Append(CCFLAGS=["-Wlogical-op"]) elif methods.using_clang(env) or methods.using_emcc(env): - env.Append(CCFLAGS=["-Wimplicit-fallthrough", "-Wno-undefined-var-template"]) + env.Append(CCFLAGS=["-Wimplicit-fallthrough"]) elif env["warnings"] == "all": env.Append(CCFLAGS=["-Wall"] + common_warnings) elif env["warnings"] == "moderate": diff --git a/core/os/safe_binary_mutex.h b/core/os/safe_binary_mutex.h index 4ca4b50b02c..1035ee76b4b 100644 --- a/core/os/safe_binary_mutex.h +++ b/core/os/safe_binary_mutex.h @@ -37,6 +37,11 @@ #ifdef THREADS_ENABLED +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wundefined-var-template" +#endif + // A very special kind of mutex, used in scenarios where these // requirements hold at the same time: // - Must be used with a condition variable (only binary mutexes are suitable). @@ -105,6 +110,10 @@ public: } }; +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + #else // No threads. template