-
Notifications
You must be signed in to change notification settings - Fork 2k
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
CODING_CONVENTIONS.md: Elaborate on C11 compliance #21140
Conversation
- `__attribute__((used))`, `__attribute__((section("...")))`, | ||
`__attribute__((weak))`, and `__attribute__((alias("...")))` |
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.
Notably missing but used in the code base:
__attribute__((always_inline))
: This should be IMO a wrapper incompiler_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 provides
alignas()and the
_Alignas()` since C11, so no need to use an extension for this.
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.
I think this is useful information to have. You get 1 ACK from me :)
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.
Just two nits, otherwise another ACK from my side. Thanks for writing this up!
This adds reasoning for requiring standard compliant C code, and lists generally accepted exceptions to this rule. Co-authored-by: mguetschow <[email protected]>
b437929
to
efa622b
Compare
Thx :) |
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