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

doc: coding guidelines: Add a new rule for macro name collisions #51963

Merged
merged 1 commit into from
Feb 22, 2023

Conversation

carlescufi
Copy link
Member

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

de-nordic
de-nordic previously approved these changes Nov 4, 2022
Copy link
Collaborator

@de-nordic de-nordic left a 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!

cfriedt
cfriedt previously requested changes Nov 4, 2022
Copy link
Member

@cfriedt cfriedt left a 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

doc/contribute/coding_guidelines/index.rst Outdated Show resolved Hide resolved
stephanosio
stephanosio previously approved these changes Nov 7, 2022
de-nordic
de-nordic previously approved these changes Nov 8, 2022
gmarull
gmarull previously approved these changes Nov 8, 2022
@cfriedt cfriedt dismissed their stale review November 8, 2022 18:04

It's not really of huge personal interest

tbursztyka
tbursztyka previously approved these changes Nov 14, 2022
@stephanosio
Copy link
Member

@carlescufi Shall we merge this now that nobody objects to it ?

@nashif nashif added TSC Topics that need TSC discussion DNM This PR should not be merged (Do Not Merge) labels Nov 21, 2022
jhedberg
jhedberg previously approved these changes Nov 21, 2022
@carlescufi carlescufi removed the DNM This PR should not be merged (Do Not Merge) label Feb 20, 2023
@carlescufi carlescufi added the DNM This PR should not be merged (Do Not Merge) label Feb 22, 2023
@carlescufi
Copy link
Member Author

Needs final ACK in the TSC today before merging

@mbolivar-nordic mbolivar-nordic removed the DNM This PR should not be merged (Do Not Merge) label Feb 22, 2023
@mbolivar-nordic
Copy link
Contributor

motion passed at TSC

@mbolivar-nordic mbolivar-nordic merged commit d095f7d into zephyrproject-rtos:main Feb 22, 2023
gmarull added a commit to teslabs/zephyr that referenced this pull request Apr 6, 2023
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>
gmarull added a commit to teslabs/zephyr that referenced this pull request Apr 6, 2023
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>
gmarull added a commit to teslabs/zephyr that referenced this pull request Apr 11, 2023
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>
gmarull added a commit to teslabs/zephyr that referenced this pull request Apr 11, 2023
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>
gmarull added a commit to teslabs/zephyr that referenced this pull request Apr 11, 2023
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>
gmarull added a commit to teslabs/zephyr that referenced this pull request Apr 11, 2023
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>
gmarull added a commit to teslabs/zephyr that referenced this pull request Apr 11, 2023
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>
gmarull added a commit to teslabs/zephyr that referenced this pull request Apr 12, 2023
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>
gmarull added a commit to teslabs/zephyr that referenced this pull request Apr 14, 2023
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Documentation TSC Topics that need TSC discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.