Skip to content

Commit 3232354

Browse files
fabiobaltierihenrikbrixandersen
authored andcommitted
cmake: unittest: set -Wshadow
Set -Wshadow when compiling unit tests, this way we can test macro combinations and ensure they don't generate shadowed variables, which would generate a warning by default in normal Zephyr builds. Signed-off-by: Fabio Baltieri <[email protected]>
1 parent 0db0db8 commit 3232354

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cmake/modules/unittest.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ target_compile_options(test_interface INTERFACE
111111
$<$<COMPILE_LANGUAGE:CXX>:${EXTRA_CXXFLAGS_AS_LIST}>
112112
$<$<COMPILE_LANGUAGE:ASM>:${EXTRA_AFLAGS_AS_LIST}>
113113
-Wno-format-zero-length
114+
-Wshadow
114115
)
115116

116117
target_link_options(testbinary PRIVATE

0 commit comments

Comments
 (0)