-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
drivers: reset: Use of reserved identifier assert
#46023
Comments
Could you please look into this? |
Hi! I understand the issue, but if you include assert.h after drivers/reset.h the code compiles because the assert name is not replaced by the assert define. If it is necessary, I can change assert and deassert into something else. @gmarull What do you think? |
For context, the problem appears with a reset driver (there's only |
Oh, it is clear for me now. I have 2 options to fix this: to change the name from assert and deassert to something else (I am open to any suggestions for this), or to insert "#undef assert" into include/zephyr/reset.h. @carlocaione What do you think? |
@stephanosio mentioned on Discord that this API was never part of a release, so it should be ok to modify without going through the API change process. Guess if we want to change it (I say it's the right thing to do) we should do it before v3.1 gets cut. Not sure about the naming... set/unset? |
That is going to be problematic if there is anything after the inclusion of
That would be the most viable solution in my opinion; though, it might be feasible to keep the assert/deassert nomenclature and simply prefix (or suffix) it (e.g. cc @carlescufi |
Fine to me the name change and the |
Cool, I will do a PR today with those changes. |
Describe the bug
The reset controller driver header file makes use of the identifier
assert
, which is reserved by the C standard and should not be defined outside the C library:zephyr/include/zephyr/drivers/reset.h
Line 140 in 25e6279
This causes a conflict with the newlib
assert.h
header, which defines theassert
macro that gets expanded when accessing the reset controller driver API struct memberassert
.zephyr/include/zephyr/drivers/reset.h
Line 209 in 25e6279
Logs and console output
To Reproduce
Include newlib
assert.h
anddrivers/reset.h
together.Impact
Unable to use the
drivers/reset.h
alongside the C libraryassert.h
.Environment (please complete the following information):
Additional context
Discovered in #45932
The text was updated successfully, but these errors were encountered: