This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.
See the CrossGCC FAQ for lots more information.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Hi, I want to align my structure so that they always is allocated with a 16bit alignment If i specify a structure like this: struct block { unsigned short next; union { int size; char data[4]; } file ; char datalast ; char chs ; char chs2 ; } __attribute__(( aligned(2), packed )); ...then all structures get 16bit aligned if i allocated them as an array like this: struct block test[10]; BUT, if i allocate them one by one: struct block test1; struct block test1; struct block test1; ....then i get a structure alignment of 8byte Why is that? Is there some compiler flag that i can use to make the compiler to always use 16bit alignment between varaibles/structures? Regards, Daniel ------ Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/ Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |