This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c/9932: alignment of long long in struct seems to be wrong
- From: Hagen Last <hagen at equator dot com>
- To: gcc-gnats at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, hagen at equator dot com, gcc-prs at gcc dot gnu dot org
- Date: 04 Mar 2003 09:39:11 -0800
- Subject: Re: c/9932: alignment of long long in struct seems to be wrong
- Organization: Equator Technologies, Inc.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9932
I don't know if there is a formal specification for the correct
alignment of 64-bit data types on x86 linux. I think that's up to the
compiler (I was actually told by one of our compiler guys that I should
not assume anything about alignment of data types).
But from what I understand structs must be aligned to the largest
alignment of its members. So, if the alignment of a 64-bit type is 8
(for a specific compiler) then it must also align a struct that has a
member of this data type to (at least) 8.
Hagen.