-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
doc: avoid non-standard value for Kconfig predefines #21726
Conversation
When building with Kconfig a symbol CONFIG_FOO is either undefined, or defined to the integer literal 1. There are styles and use cases where this is important, e.g. using "#if (CONFIG_FOO - 0)" which would not work with a macro expanding to the identifier y. Use the standard default definition instead of a special non-default one. Also consistently use space rather than tab indentation within the multi-line setting, and alphabetize the CONFIG_ predefines. Signed-off-by: Peter Bigot <[email protected]>
Looks fine to me. Conflicts with #21727, fix is trivial for whoever gets merged first. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this isn't right, if you want to mimic exactly what ends up in autoconf.h you need to define these all to '1'
please look for "autoconf.h" in a build directory to see what I mean
No we don't. As the comment before
|
A bit subtle for my taste, why not just explicitly set to "1" and avoid confusing people? |
Mostly because Doxygen is doing exactly what make(1) does when given
Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I think.
When building with Kconfig a symbol CONFIG_FOO is either undefined, or
defined to the integer literal 1. There are styles and use cases
where this is important, e.g. using "#if (CONFIG_FOO - 0)" which would
not work with a macro expanding to the identifier y. Use the standard
default definition instead of a special non-default one.
Also consistently use space rather than tab indentation within the
multi-line setting, and alphabetize the CONFIG_ predefines.
(This is cleanup preparatory to adding another predefine in a PR where documentation should always be generated for API that's available conditional on
CONFIG_POLL
. A more complex alternative is to drop all these Kconfig symbols and add a predefineDOXYGEN
as suggested by https://gist.github.com/mbolivar/cd82dd45dd0d2ea153425c9506d61929 following the standard practice demonstrated atzephyr/ext/hal/cmsis/Core_R/Include/core_cr.h
Line 277 in 78c6241