abi-aa icon indicating copy to clipboard operation
abi-aa copied to clipboard

Clarify the role of packed types in computing natural alignment

Open rjmccall opened this issue 1 year ago • 1 comments

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.

rjmccall avatar Jul 01 '24 15:07 rjmccall

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.

rearnsha avatar Jul 23 '24 14:07 rearnsha