Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logging: Fix compilation errors with clang++ when printing void* #87310

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rysiof
Copy link
Contributor

@rysiof rysiof commented Mar 18, 2025

Arguments logged with %p casted to void * are working fine with gcc, g++
and clang. however with clang++ it causes compilation error that cannot
be suppressed: error: arithmetic on a pointer to void.

Link: https://docs.zephyrproject.org/latest/services/logging/index.html
Link: https://gcc.gnu.org/legacy-ml/gcc/2016-02/msg00266.html

Fixes: #87308

Signed-off-by: Maciej Kusio [email protected]

@zephyrbot zephyrbot added size: XS A PR changing only a single line of code area: Logging labels Mar 18, 2025
Arguments logged with %p casted to void * are working fine with gcc, g++ and
clang. however with clang++ it causes compilation error that cannot be
suppressed: error: arithmetic on a pointer to void.

Link: https://docs.zephyrproject.org/latest/services/logging/index.html#recommendations
Link: https://gcc.gnu.org/legacy-ml/gcc/2016-02/msg00266.html

Fixes: zephyrproject-rtos#87308

Signed-off-by: Maciej Kusio <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Logging size: XS A PR changing only a single line of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

logging: logging void * does not work when compiling with clang++
3 participants