You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After commit 524b72c ("toolchain: llvm: Provide working
BUILD_ASSERT macro") when compiling with clang we have actual
checks and a real assert check using _Static_assert.
Now, when compiling with clang (used by Xtensa internal toolchain)
we get the following error.
$ zephyr/drivers/dai/nxp/sai/sai.c:968:29: error: static_assert expression
is not an integral constant expression
We get this in asserts like this:
BUILD_ASSERT(SAI_DLINE_COUNT(inst) != -1, "...").
This expands to (reduced the macro to easier understand the context):
_Static_assert(((((((I2S_Type *)(uintptr_t)(1493499904U))) ==
((I2S_Type *)(0x59040000u)))
... and clang complains that this is not a constant expression.
So, in order to fix the compile time error remove the compile time
asserts and replace them with runtime checks.
Signed-off-by: Daniel Baluta <[email protected]>
Fixes: commit 524b72c ("toolchain: llvm: Provide working
BUILD_ASSERT macro")
0 commit comments