This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: How to pack structures on word boundaries
- From: Der Herr Hofrat <der dot herr at mail dot hofr dot at>
- To: Hossain Altaf-EMH028 <Altaf dot Hossain at motorola dot com>
- Cc: "'gcc-help at gcc dot gnu dot org'" <gcc-help at gcc dot gnu dot org>
- Date: Wed, 11 Sep 2002 21:10:28 +0200 (CEST)
- Subject: Re: How to pack structures on word boundaries
> Hi :
> I am using the gcc compiler. If I use -fpack-struct option to
> compile my c program, it packs the structure on a byte boundary.
>
> How can I force gcc to pack on word boundary?
>
> Is there another option or command for packing on word boundary?
>
use the aligned (NR_BYTES) (or __aligned__ (NR_BYTES) for header files) to
pass gcc the alignment for an object - see the section "Specfiying Attributes of Types" in the gcc info pages.
hofrat