Related articles |
---|
GCC Struct layout rhyde@cs.ucr.edu (Randall Hyde) (2002-04-19) |
Re: GCC Struct layout loewis@informatik.hu-berlin.de (2002-04-19) |
Re: GCC Struct layout wilson@redhat.com (Jim Wilson) (2002-04-19) |
From: | loewis@informatik.hu-berlin.de (Martin v. =?iso-8859-1?q?L=F6wis?=) |
Newsgroups: | comp.compilers |
Date: | 19 Apr 2002 22:54:14 -0400 |
Organization: | Humboldt University Berlin, Department of Computer Science |
References: | 02-04-115 |
Keywords: | C, GCC, architecture |
Posted-Date: | 19 Apr 2002 22:54:14 EDT |
"Randall Hyde" <rhyde@cs.ucr.edu> writes:
> I need a pointer to some documentation that *fully* describes how GCC
> lays out fields in structs (alignment, padding, etc.).
There is no such documentation.
> I am quite aware of the alignment attribute, I'm mainly worried
> about the default alignment of struct fields (no alignment
> explicitly specified).
That depends on the target (as John points out). Even for x86,
different targets may use different strategies. On most targets, gcc
implements the vendor's ABI. Therefore, you need to read the ABI of
the vendor. For SysV, that means you need to read both the gABI, and
the 386 psABI.
HTH,
Martin
Return to the
comp.compilers page.
Search the
comp.compilers archives again.