Skip to content

Commit

Permalink
cmake: c++ compiler flag exclusion, -Werror=implicit-int
Browse files Browse the repository at this point in the history
Fixes: zephyrproject-rtos#28097

The compiler warning flag `-Werror=implicit-int` was added using
`set_compiler_property()` which will always add the compiler flag if the
compiler flag supports it.

This has been changed to `check_set_compiler_property()` which will
check if the flag is among the list of `CXX_EXCLUDED_OPTIONS`, and only
adds the flag if both the compiler supports it, and it is not an
excluded option.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
  • Loading branch information
tejlmand committed Sep 7, 2020
1 parent 016b542 commit c880f81
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmake/compiler/arcmwdt/compiler_flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ check_set_compiler_property(PROPERTY warning_extended
-Wno-tautological-compare
)

set_compiler_property(PROPERTY warning_error_implicit_int -Werror=implicit-int)
check_set_compiler_property(PROPERTY warning_error_implicit_int -Werror=implicit-int)

set_compiler_property(PROPERTY warning_error_misra_sane -Werror=vla)

Expand Down
2 changes: 1 addition & 1 deletion cmake/compiler/gcc/compiler_flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ check_set_compiler_property(APPEND PROPERTY warning_dw_3

set_compiler_property(PROPERTY warning_extended -Wno-unused-but-set-variable)

set_compiler_property(PROPERTY warning_error_implicit_int -Werror=implicit-int)
check_set_compiler_property(PROPERTY warning_error_implicit_int -Werror=implicit-int)

set_compiler_property(PROPERTY warning_error_misra_sane -Werror=vla)

Expand Down

0 comments on commit c880f81

Please sign in to comment.