-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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: coding guidelines: Add a new rule for macro name collisions #51963
doc: coding guidelines: Add a new rule for macro name collisions #51963
Conversation
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.
Finally carved in stone. 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.
Either the wording is very confusing or this rule is being broken already
e425ace
2881112
to
d3d7c1c
Compare
It's not really of huge personal interest
@carlescufi Shall we merge this now that nobody objects to it ? |
Needs final ACK in the TSC today before merging |
motion passed at TSC |
We've been guarding the definition of MIN/MAX/CLAMP macros as they are commonly found in other projects. This is dangerous, because depending on the order of includes, Zephyr code could end up using macros defined by other projects (e.g. via HALs). The current #ifndef _protection_ goes against the recently established guidelines in zephyrproject-rtos#51963, so let's remove it. Ref. https://docs.zephyrproject.org/latest/contribute/coding_guidelines/ index.html#rule-a-3-macro-name-collisions Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
We've been guarding the definition of BIT/MIN/MAX/CLAMP macros as they are commonly found in other projects. This is dangerous, because depending on the order of includes, Zephyr code could end up using macros defined by other projects (e.g. via HALs). The current #ifndef _protection_ goes against the recently established guidelines in zephyrproject-rtos#51963, so let's remove it. Ref. https://docs.zephyrproject.org/latest/contribute/coding_guidelines/ index.html#rule-a-3-macro-name-collisions Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
We've been guarding the definition of BIT/MIN/MAX/CLAMP macros as they are commonly found in other projects. This is dangerous, because depending on the order of includes, Zephyr code could end up using macros defined by other projects (e.g. via HALs). The current #ifndef _protection_ goes against the recently established guidelines in zephyrproject-rtos#51963, so let's remove it. Ref. https://docs.zephyrproject.org/latest/contribute/coding_guidelines/ index.html#rule-a-3-macro-name-collisions Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
We've been guarding the definition of BIT/MIN/MAX/CLAMP macros as they are commonly found in other projects. This is dangerous, because depending on the order of includes, Zephyr code could end up using macros defined by other projects (e.g. via HALs). The current #ifndef _protection_ goes against the recently established guidelines in zephyrproject-rtos#51963, so let's remove it. Ref. https://docs.zephyrproject.org/latest/contribute/coding_guidelines/ index.html#rule-a-3-macro-name-collisions Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
We've been guarding the definition of BIT/MIN/MAX/CLAMP macros as they are commonly found in other projects. This is dangerous, because depending on the order of includes, Zephyr code could end up using macros defined by other projects (e.g. via HALs). The current #ifndef _protection_ goes against the recently established guidelines in zephyrproject-rtos#51963, so let's remove it. Ref. https://docs.zephyrproject.org/latest/contribute/coding_guidelines/ index.html#rule-a-3-macro-name-collisions Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
We've been guarding the definition of BIT/MIN/MAX/CLAMP macros as they are commonly found in other projects. This is dangerous, because depending on the order of includes, Zephyr code could end up using macros defined by other projects (e.g. via HALs). The current #ifndef _protection_ goes against the recently established guidelines in zephyrproject-rtos#51963, so let's remove it. Ref. https://docs.zephyrproject.org/latest/contribute/coding_guidelines/ index.html#rule-a-3-macro-name-collisions Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
We've been guarding the definition of BIT/MIN/MAX/CLAMP macros as they are commonly found in other projects. This is dangerous, because depending on the order of includes, Zephyr code could end up using macros defined by other projects (e.g. via HALs). The current #ifndef _protection_ goes against the recently established guidelines in zephyrproject-rtos#51963, so let's remove it. Ref. https://docs.zephyrproject.org/latest/contribute/coding_guidelines/ index.html#rule-a-3-macro-name-collisions Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
We've been guarding the definition of BIT/MIN/MAX/CLAMP macros as they are commonly found in other projects. This is dangerous, because depending on the order of includes, Zephyr code could end up using macros defined by other projects (e.g. via HALs). The current #ifndef _protection_ goes against the recently established guidelines in zephyrproject-rtos#51963, so let's remove it. Ref. https://docs.zephyrproject.org/latest/contribute/coding_guidelines/ index.html#rule-a-3-macro-name-collisions Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
We've been guarding the definition of BIT/MIN/MAX/CLAMP macros as they are commonly found in other projects. This is dangerous, because depending on the order of includes, Zephyr code could end up using macros defined by other projects (e.g. via HALs). The current #ifndef _protection_ goes against the recently established guidelines in zephyrproject-rtos#51963, so let's remove it. Ref. https://docs.zephyrproject.org/latest/contribute/coding_guidelines/ index.html#rule-a-3-macro-name-collisions Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is the outcome of the discussion that has taken place in multiple forums:
Discord:
https://discord.com/channels/720317445772017664/1014241011989487716/1032623375228608522
GitHub:
#51371 #50239
Signed-off-by: Carles Cufi carles.cufi@nordicsemi.no