CODING_CONVENTIONS.md: Elaborate on C11 compliance#21140
Merged
MrKevinWeiss merged 1 commit intoRIOT-OS:masterfrom Jan 21, 2025
Merged
CODING_CONVENTIONS.md: Elaborate on C11 compliance#21140MrKevinWeiss merged 1 commit intoRIOT-OS:masterfrom
MrKevinWeiss merged 1 commit intoRIOT-OS:masterfrom
Conversation
maribu
commented
Jan 19, 2025
Comment on lines
+73
to
+74
| - `__attribute__((used))`, `__attribute__((section("...")))`, | ||
| `__attribute__((weak))`, and `__attribute__((alias("...")))` |
Member
Author
There was a problem hiding this comment.
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 providesalignas()and the_Alignas()` since C11, so no need to use an extension for this.
MrKevinWeiss
approved these changes
Jan 20, 2025
Contributor
MrKevinWeiss
left a comment
There was a problem hiding this comment.
I think this is useful information to have. You get 1 ACK from me :)
mguetschow
approved these changes
Jan 20, 2025
Contributor
mguetschow
left a comment
There was a problem hiding this comment.
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
Member
Author
|
Thx :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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