util.h: #include zephyr/toolchain.h, not zephyr/toolchain/common.h #62620
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Commit 9c5dafe ("util: add type checking to CONTAINER_OF") made
util.h
#includetoolchain/common.h
in order to getBUILD_ASSERT()
used by CONTAINER_OF_VALIDATE() when compiling C code.However
toolchain/common.h
is not supposed to be included directly but indirectly throughtoolchain/<your_toolchain>.h
and in a very specific order.The direct inclusion caused the following warning when compiling C++:
Fix this issue #62464 by including
zephyr/toolchain.h
instead, as done by 350 other files.Fixes commit 9c5dafe ("util: add type checking to CONTAINER_OF")