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

sys: cbprintf: logging: Fix opaque struct pointer warning #87461

Merged
merged 1 commit into from
Mar 25, 2025

Conversation

nordic-krch
Copy link
Collaborator

@nordic-krch nordic-krch commented Mar 21, 2025

Use compiler trick to allow operations with all types of arguments. Previous solution was using arg+0 with suppressing compiler warning about pointer arithmetic operations but it was not covering for opaque struct pointers.

As suggested in #87310 it is possible to cover for opaque pointers in logging using the same approach.

Fixes #85775

Use compiler trick to allow operations with all types of arguments.
Previous solution was using arg+0 with suppressing compiler warning
about pointer arithmetic operations but it was not covering for
opaque struct pointers.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
@jhedberg
Copy link
Member

@nordic-krch I added the "Fixes ..." reference to the PR description to point at my bug report, or will there still be some cases that are not covered by this solution?

@kartben kartben merged commit 1ac19d3 into zephyrproject-rtos:main Mar 25, 2025
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

logging: Suspicious usage of 'sizeof()' on an expression of pointer type [bugprone-sizeof-expression]
5 participants