GCC Struct layout

"Randall Hyde" <rhyde@cs.ucr.edu>
19 Apr 2002 11:30:18 -0400

          From comp.compilers

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)
| List of all articles for this month |
From: "Randall Hyde" <rhyde@cs.ucr.edu>
Newsgroups: comp.compilers
Date: 19 Apr 2002 11:30:18 -0400
Organization: Prodigy Internet http://www.prodigy.com
Keywords: C, storage
Posted-Date: 19 Apr 2002 11:30:18 EDT

I need a pointer to some documentation that *fully* describes how GCC
lays out fields in structs (alignment, padding, etc.). I'm working on
a different compiler and I need to be able to create structs that are
binary compatible (on the x86) with GCC's structs. Note that the man
and info pages don't even come close.


I am quite aware of the alignment attribute, I'm mainly worried about
the default alignment of struct fields (no alignment explicitly
specified).


Thanks,
Randy Hyde
[I believe it's part of the per-target configuration. A good guess is that
objects will be aligned on multiples of their size, up to the word size
of the target machine. -John]



Post a followup to this message

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