This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: On alignment
- From: Michael Matz <matz at suse dot de>
- To: Jason Merrill <jason at redhat dot com>
- Cc: <gcc at gcc dot gnu dot org>, Andrew Haley <aph at redhat dot com>,Jakub Jelinek <jakub at redhat dot com>
- Date: Fri, 21 Mar 2003 16:18:32 +0100 (CET)
- Subject: Re: On alignment
Hi,
On Thu, 20 Mar 2003, Jason Merrill wrote:
> Do people think this bug is worth fixing? The behavior is rather
> surprising, but changing it might break binary compatibility for affected
> code--of which there's not likely to be very much, but there could be some.
> Code which really wants, say, aligment of 4 for long long could say
> __attribute__ ((packed, aligned (4))). On the other hand, the change would
> restore binary compatibility with 2.95 for C code.
This would change e.g the layout of things like:
struct A { int i; };
struct B { struct A a; long long int __attribute__((aligned(4))) li; };
struct C { struct B b; int j; };
, right? If yes I think there is not exactly few code which would be
broken binary compatibility wise. I've seen strange things for instance
in OpenOffice, where they play with alignments. And to this end
compatibility with 3.x matters more that with 2.95.x.
Ciao,
Michael.