Z_POW2_CEIL: simplify implementation
Avoid potentially calling __builtin_clz() twice with non-constant values. Also add a test for it. Clang produces false positive vla warnings so disable them. GCC will spot real vla's already. Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
This commit is contained in:
parent
92bc3e47c0
commit
f00573555b
5 changed files with 89 additions and 13 deletions
|
@ -381,6 +381,9 @@ if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
|||
if(NOT ${ZEPHYR_TOOLCHAIN_VARIANT} STREQUAL "xcc")
|
||||
zephyr_cc_option(-fno-defer-pop)
|
||||
endif()
|
||||
else()
|
||||
# Clang produces false positive vla warnings
|
||||
zephyr_cc_option(-Wno-vla)
|
||||
endif()
|
||||
|
||||
zephyr_cc_option_ifdef(CONFIG_STACK_USAGE -fstack-usage)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue