From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier Galibert To: Andrew Haley Cc: Mark Mitchell , gcc@gcc.gnu.org Subject: Re: RFC: attribute "unpadded" Date: Fri, 23 Aug 2002 16:42:00 -0000 Message-id: <20020823194250.A3239@zalem.puupuu.org> References: <3627294541.1030124478@[192.168.0.103]> <15718.30109.330134.410703@cuddles.cambridge.redhat.com> X-SW-Source: 2002-08/msg01497.html 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.