Meta: Enable -Wexpansion-to-defined warning for Clang

The Clang implementation of this warning protects against some undefined
pre-processor behavior while ignoring function-like macros. The gcc
implementation also warns on function-like macros, and is therefore
noisy.
This commit is contained in:
Andrew Kaster 2022-01-03 01:28:12 -07:00 committed by Brian Gianforcaro
parent ba2ca54660
commit ed3cb88898
Notes: sideshowbarker 2024-07-17 21:43:20 +09:00

View file

@ -164,7 +164,6 @@ add_compile_options(-Wno-address-of-packed-member)
add_compile_options(-Wcast-qual)
add_compile_options(-Wdeprecated-copy)
add_compile_options(-Wduplicated-cond)
add_compile_options(-Wno-expansion-to-defined)
add_compile_options(-Wformat=2)
add_compile_options(-Wimplicit-fallthrough)
add_compile_options(-Wlogical-op)
@ -191,6 +190,8 @@ add_compile_options(-g1)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options(-Wno-literal-suffix)
add_compile_options(-Wno-maybe-uninitialized)
# Only ignore expansion-to-defined for g++, clang's implementation doesn't complain about function-like macros
add_compile_options(-Wno-expansion-to-defined)
add_compile_options(-Wcast-align)
add_compile_options(-Wdouble-promotion)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang$")