This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]