This is the mail archive of the gcc-bugs@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: c/9932: alignment of long long in struct seems to be wrong


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.


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