* How to pack structures on word boundaries
@ 2002-09-11 13:02 Hossain Altaf-EMH028
2002-09-11 13:07 ` Der Herr Hofrat
0 siblings, 1 reply; 2+ messages in thread
From: Hossain Altaf-EMH028 @ 2002-09-11 13:02 UTC (permalink / raw)
To: 'gcc-help@gcc.gnu.org'
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?
Thanks
Mohammed Altaf Hossain
Motorola, Inc.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: How to pack structures on word boundaries
2002-09-11 13:02 How to pack structures on word boundaries Hossain Altaf-EMH028
@ 2002-09-11 13:07 ` Der Herr Hofrat
0 siblings, 0 replies; 2+ messages in thread
From: Der Herr Hofrat @ 2002-09-11 13:07 UTC (permalink / raw)
To: Hossain Altaf-EMH028; +Cc: 'gcc-help@gcc.gnu.org'
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-09-11 20:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-11 13:02 How to pack structures on word boundaries Hossain Altaf-EMH028
2002-09-11 13:07 ` Der Herr Hofrat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).