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

tree-wide: use alignas() for alignment #21148

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

Conversation

maribu
Copy link
Member

@maribu maribu commented Jan 21, 2025

Contribution description

  • Use of __attribute__((aligned(<NUM>))) is a compiler extension. We can just use alignas(), which is part of the C standard since C11
  • Use of _Alignas() is a keyword since C11 and alignas() the alias provided by <stdalign.h>. But _Alignas() is deprecated since C23. Let's just go for alignas() instead.

Testing procedure

alignas() and __attribute__((aligned())) have the same semantics, but alignas() cannot be placed as freely as the __attribute__((aligned())) variant. But the CI will catch syntax errors.

Issues/PRs references

None

- Use of `__attribute__((aligned(<NUM>)))` is a compiler extension. We
  can just use `alignas()`, which is part of the C standard since C11
- Use of `_Alignas()` is a keyword since C11 and `alignas()` the alias
  provided by `<stdalign.h>`. But `_Alignas()` is deprecated since C23.
  Let's just go for `alignas()` instead.
@maribu maribu added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jan 21, 2025
@github-actions github-actions bot added Platform: native Platform: This PR/issue effects the native platform Platform: ARM Platform: This PR/issue effects ARM-based platforms Area: doc Area: Documentation Area: tests Area: tests and testing framework Area: core Area: RIOT kernel. Handle PRs marked with this with care! Area: drivers Area: Device drivers Area: boards Area: Board ports Platform: ESP Platform: This PR/issue effects ESP-based platforms Platform: RISC-V Platform: This PR/issue effects RISC-V-based platforms Area: cpu Area: CPU/MCU ports Area: sys Area: System Area: examples Area: Example Applications labels Jan 21, 2025
@riot-ci
Copy link

riot-ci commented Jan 21, 2025

Murdock results

FAILED

534a2d2 tree-wide: use alignas() for alignment

Success Failures Total Runtime
42 0 9268 01m:31s

Artifacts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports Area: core Area: RIOT kernel. Handle PRs marked with this with care! Area: cpu Area: CPU/MCU ports Area: doc Area: Documentation Area: drivers Area: Device drivers Area: examples Area: Example Applications Area: sys Area: System Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms Platform: ESP Platform: This PR/issue effects ESP-based platforms Platform: native Platform: This PR/issue effects the native platform Platform: RISC-V Platform: This PR/issue effects RISC-V-based platforms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants