Description
Describe the bug
https://docs.zephyrproject.org/latest/services/logging/index.html#recommendations recommends to cast arguments logged with %p to void *, and it works fine with gcc, g++ and clang. however with clang++ it causes error that cannot be suppressed: error: arithmetic on a pointer to void
.
It is because we are using (arg) + 0 inside _Generic to workaround issues with _Generic and bit fields.
https://gcc.gnu.org/legacy-ml/gcc/2016-02/msg00266.html suggests to use different syntax: 0:(arg):(arg)
. This seems to be working with gcc, g++, clang and clang++
To Reproduce
Add LOG_WRN("%p", (void *)str);
to c++ code and compile with clang++
Expected behavior
No errors
Impact
Impacts C++ code compiled with clang++ code, for example Xtensa targets with RJ-2024.3 toolchain
Logs and console output
Environment (please complete the following information):
All
Additional context