Build: enable mismatched-tags warning for CLANG

Disabled for GCC as this causes a crash which isn't practical to
workaround, details in code-comments.
This commit is contained in:
Campbell Barton 2023-12-08 16:22:18 +11:00
parent 77695da84b
commit 4fd8f6c575
1 changed files with 13 additions and 1 deletions

View File

@ -1784,13 +1784,22 @@ if(CMAKE_COMPILER_IS_GNUCC)
CXX_WARN_NO_SUGGEST_OVERRIDE -Wno-suggest-override
CXX_WARN_UNINITIALIZED -Wuninitialized
# NOTE(@ideasman42): In GCC 13.2.1 on Linux this causes internal compiler errors.
# The crashes can be resolved by disabling the flag per module (but not via pragmas).
# However this also causes a type mix-up FreeStyle (Blender & FreeStyle's `Curve`)
# so it seems to impact GCC's the internal state enough that it's too risky to enable.
# Once this flag has been removed for the modules where this occurs.
# When this is resolved the check can be enabled for fixed GCC versions.
#
# Prevents linking errors with MSVC.
# `CXX_WARN_MISMATCHED_TAGS -Wmismatched-tags`
# Useful but too many false positives and inconvenient to suppress each occurrence.
CXX_WARN_NO_STRINGOP_OVERREAD -Wno-stringop-overread
CXX_WARN_NO_STRINGOP_OVERFLOW -Wno-stringop-overflow
# Use `[[fallthrough]]` or `ATTR_FALLTHROUGH` macro to suppress.
CXX_WARN_IMPLICIT_FALLTHROUGH -Wimplicit-fallthrough=5
)
# causes too many warnings
@ -1893,6 +1902,9 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
CXX_WARN_UNDEF_PREFIX -Wundef-prefix
CXX_WARN_UNUSED_PARAMETER -Wunused-parameter
# Prevents linking errors with MSVC.
CXX_WARN_MISMATCHED_TAGS -Wmismatched-tags
# Gives too many unfixable warnings.
# `C_WARN_UNUSED_MACROS -Wunused-macros`
# `CXX_WARN_UNUSED_MACROS -Wunused-macros`