Skip to content

Commit

Permalink
Meta: Enable -Wexpansion-to-defined warning for Clang
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ADKaster authored and bgianfo committed Jan 4, 2022
1 parent ba2ca54 commit ed3cb88
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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$")
Expand Down

0 comments on commit ed3cb88

Please sign in to comment.