compiler: do not allow expansion-to-defined
'-Wexpansion-to-defined' Warn whenever 'defined' is encountered in the expansion of a macro (including the case where the macro is expanded by an '#if' directive). Such usage is not portable. This warning is also enabled by '-Wpedantic' and '-Wextra'. This is enabled by default in llvm but not in gcc. Given that it is 'not portable', lets disallow this in gcc and keep both compilers in sync. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
c860b86822
commit
c7bc6380bd
1 changed files with 3 additions and 0 deletions
|
@ -39,6 +39,9 @@ check_set_compiler_property(APPEND PROPERTY warning_base -Wno-pointer-sign)
|
||||||
# Prohibit void pointer arithmetic. Illegal in C99
|
# Prohibit void pointer arithmetic. Illegal in C99
|
||||||
check_set_compiler_property(APPEND PROPERTY warning_base -Wpointer-arith)
|
check_set_compiler_property(APPEND PROPERTY warning_base -Wpointer-arith)
|
||||||
|
|
||||||
|
# not portable
|
||||||
|
check_set_compiler_property(APPEND PROPERTY warning_base -Wexpansion-to-defined)
|
||||||
|
|
||||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "9.1.0")
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "9.1.0")
|
||||||
set_compiler_property(APPEND PROPERTY warning_base
|
set_compiler_property(APPEND PROPERTY warning_base
|
||||||
# FIXME: Remove once #16587 is fixed
|
# FIXME: Remove once #16587 is fixed
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue