diff --git a/build/make/warnings-clang.mk b/build/make/warnings-clang.mk index 0390bd484cc..5c7879373ae 100644 --- a/build/make/warnings-clang.mk +++ b/build/make/warnings-clang.mk @@ -2,8 +2,8 @@ CXXFLAGS_WARNINGS += -Wcast-align -Wcast-qual -Wdouble-promotion -Wfloat-conversion -Wmissing-prototypes -Wshift-count-negative -Wshift-count-overflow -Wshift-op-parentheses -Wshift-overflow -Wshift-sign-overflow -Wundef CFLAGS_WARNINGS += -Wcast-align -Wcast-qual -Wdouble-promotion -Wfloat-conversion -Wmissing-prototypes -Wshift-count-negative -Wshift-count-overflow -Wshift-op-parentheses -Wshift-overflow -Wshift-sign-overflow -Wundef -CXXFLAGS_WARNINGS += -Wdeprecated -Wextra-semi -Wframe-larger-than=16000 -Wglobal-constructors -Wimplicit-fallthrough -Wmissing-declarations -Wnon-virtual-dtor -Wreserved-id-macro -CFLAGS_WARNINGS += -Wframe-larger-than=4000 +CXXFLAGS_WARNINGS += -Wdeprecated -Wexit-time-destructors -Wextra-semi -Wframe-larger-than=16000 -Wglobal-constructors -Wimplicit-fallthrough -Wmissing-declarations -Wnon-virtual-dtor -Wreserved-id-macro +CFLAGS_WARNINGS += -Wframe-larger-than=4000 #CXXFLAGS_WARNINGS += -Wfloat-equal #CXXFLAGS_WARNINGS += -Wdocumentation diff --git a/common/ComponentManager.h b/common/ComponentManager.h index 201945d7919..0a278a72fe4 100644 --- a/common/ComponentManager.h +++ b/common/ComponentManager.h @@ -438,8 +438,15 @@ inline mpt::PathString GetComponentPath() template std::shared_ptr GetComponent() { +#if MPT_COMPILER_CLANG +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wexit-time-destructors" +#endif // MPT_COMPILER_CLANG static std::weak_ptr cache; static mpt::mutex m; +#if MPT_COMPILER_CLANG +#pragma clang diagnostic pop +#endif // MPT_COMPILER_CLANG mpt::lock_guard l(m); mpt::lock_guard l(m); std::shared_ptr component = cache.lock(); if(!component) diff --git a/common/mptRandom.cpp b/common/mptRandom.cpp index 1830724a81c..a209a72200b 100644 --- a/common/mptRandom.cpp +++ b/common/mptRandom.cpp @@ -45,13 +45,27 @@ mpt::thread_safe_prng & global_prng() mpt::random_device & global_random_device() { +#if MPT_COMPILER_CLANG +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wexit-time-destructors" +#endif // MPT_COMPILER_CLANG static mpt::random_device g_rd; +#if MPT_COMPILER_CLANG +#pragma clang diagnostic pop +#endif // MPT_COMPILER_CLANG return g_rd; } mpt::thread_safe_prng & global_prng() { +#if MPT_COMPILER_CLANG +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wexit-time-destructors" +#endif // MPT_COMPILER_CLANG static mpt::thread_safe_prng g_global_prng(mpt::make_prng(global_random_device())); +#if MPT_COMPILER_CLANG +#pragma clang diagnostic pop +#endif // MPT_COMPILER_CLANG return g_global_prng; }