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

CODING_CONVENTIONS.md: Elaborate on C11 compliance #21140

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maribu
Copy link
Member

@maribu maribu commented Jan 19, 2025

Contribution description

This adds reasoning for requiring standard compliant C code, and lists generally accepted exceptions to this rule.

Testing procedure

Read the changes and reasoning.

Issues/PRs references

https://forum.riot-os.org/t/notes-virtual-maintainer-assembly-vma-2024-11/4428

This adds reasoning for requiring standard compliant C code, and lists
generally accepted exceptions to this rule.
@maribu maribu requested a review from jia200x as a code owner January 19, 2025 21:17
@github-actions github-actions bot added the Area: doc Area: Documentation label Jan 19, 2025
Comment on lines +73 to +74
- `__attribute__((used))`, `__attribute__((section("...")))`,
`__attribute__((weak))`, and `__attribute__((alias("...")))`
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notably missing but used in the code base:

  • __attribute__((always_inline)): This should be IMO a wrapper in compiler_hints.h. A compiler not supporting this will generate less efficient code (assuming this is actually sensibly used), but correct code, if this is ignored
  • __attribute__((align(N)))/attribute((aligned(N))): There is now <stdalign.h>that providesalignas()and the_Alignas()` since C11, so no need to use an extension for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: doc Area: Documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant