Structure alignment problem

Dennis Tubbs dennistubbs@wageswebworks.com
Mon Nov 4 05:27:00 GMT 2002


Are you compiling with the switch -malign-int or something similar?

-----Original Message-----
From: crossgcc-owner@sources.redhat.com
[mailto:crossgcc-owner@sources.redhat.com]On Behalf Of
Matthew.R.Wette@jpl.nasa.gov
Sent: Saturday, November 02, 2002 9:49 AM
To: Nicolas Moreau
Cc: crossgcc@sources.redhat.com
Subject: Re: Structure alignment problem


> Does some know why I get this with GCC 2.95.3 (arm-elf) ?
>
> typedef struct {
>     unsigned char Var1 __attribute__((packed)) ;
> } mystruct;
>
> sizeof(mystruct) = 4 !!

alignment? (think about arrays of mystruct)




------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com



More information about the crossgcc mailing list