This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: structure members of packed structures
- From: Hans-Peter Nilsson <hp at bitrange dot com>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: Nathan Sidwell <nathan at codesourcery dot com>, <gcc at gcc dot gnu dot org>, Mark Mitchell <mark at codesourcery dot com>, <dalej at apple dot com>
- Date: Tue, 15 Jul 2003 08:19:57 -0400 (EDT)
- Subject: Re: structure members of packed structures
On Tue, 15 Jul 2003, Andreas Schwab wrote:
> Hans-Peter Nilsson <hp@bitrange.com> writes:
>
> |> By the way, we're discussing a special case of attribute ((aligned (N))).
>
> I don't think so. Only packed can decrease the alignment, dropping
> aligned(N) does not affect correctness.
You're right, at least as far as trivial modifications of
example code goes. Wow. Not exactly intuitive but it *is*
documented.
Still, since aligned (N) can increase alignment and as such
affect structure layout (see example in node Variable Attributes
in extend.texi), it needs to be handled in *some* way when also
handling (propagating or disallowing) attribute packed.
Maybe just treating any such attribute incompatible with any
other different-N attribute (with plain aligned and packed as
two others) would be usable.
brgds, H-P