RFC: attribute "unpadded"
Olivier Galibert
galibert@pobox.com
Fri Aug 23 16:42:00 GMT 2002
On Fri, Aug 23, 2002 at 06:49:17PM +0100, Andrew Haley wrote:
> Documenting the semantics of (attribute "unpadded") and (attribute
> "aligned") and (attribute "packed") and the way that they interact in
> a way that is comprehensible to a programmer will present some poor
> soul with quite a challenge.
Maybe you want to define that in terms of internal alignment (within
the structure) and external alignment (when you put these structures
next to each other, i.e. sizeof() in practice).
Then:
- unpadded = set external alignment to 1
- packed = set internal alignment to 1
- aligned(n) = set internal and external alignment to n
Order matters, or unpadded/packed trump aligned.
Of course, all accessibility bets/arrays are off when
external alignment < internal alignment.
OG.
More information about the Gcc
mailing list