Re: GCC Struct layout (Martin v. =?iso-8859-1?q?L=F6wis?=)
19 Apr 2002 22:54:14 -0400

          From comp.compilers

Related articles
GCC Struct layout (Randall Hyde) (2002-04-19)
Re: GCC Struct layout (2002-04-19)
Re: GCC Struct layout (Jim Wilson) (2002-04-19)
| List of all articles for this month |

From: (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" <> 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.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.