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

Clarify the role of packed types in computing natural alignment #269

Open
rjmccall opened this issue Jul 1, 2024 · 1 comment
Open

Clarify the role of packed types in computing natural alignment #269

rjmccall opened this issue Jul 1, 2024 · 1 comment

Comments

@rjmccall
Copy link
Contributor

rjmccall commented Jul 1, 2024

AAPCS defines the natural alignment of a composite type as the maximum of the alignment of the members. Both GCC and Clang appear to honor __attribute__((packed)) when computing natural alignment, essentially setting the natural alignment to 1; obligatory godbolt link. This is probably worth clarifying.

@rearnsha
Copy link

The AAPCS already says
The member alignment of an element of a composite type is the alignment of that member after the application of any language alignment modifiers to that member

which I think covers it.

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

No branches or pull requests

2 participants