Structure alignment with GCC

Matthew R Wette
Fri Aug 11 13:06:00 GMT 2000

In gcc you can do

          struct s x __attribute__ ((aligned (16))) = 0;

and this will align x on a 16byte boundary, if that helps.

Christopher Bahns writes ...
> I don't think I'm concerned about structure "packing", am I? I have
> specifically been looking for documentation/options related to
> structure "alignment". I don't think I have any issues with how the
> compiler places structure fields in relation to other fields in the
> same structure. My concern is the placement of the structure itself
> in relation to what comes before it, which, as far as I can tell, is
> not related to whether or how the fields in the structure are
> packed. Naturally if someone thinks that messing around with
> structure packing might affect my alignment problem, I'd appreciate
> the info.

Want more information?  See the CrossGCC FAQ,
Want to unsubscribe? Send a note to

More information about the crossgcc mailing list