This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: how to pack data using gcc compiler?
- From: Ian Lance Taylor <ian at airs dot com>
- To: Michael Sung <mys at cisco dot com>
- Cc: gcc-help at gcc dot gnu dot org, gcc at gcc dot gnu dot org, wdai at cisco dot com
- Date: 26 Jan 2005 14:48:13 -0500
- Subject: Re: how to pack data using gcc compiler?
- References: <4.3.2.7.2.20050126114025.01c0cf70@mira-sjc5-2.cisco.com>
Michael Sung <mys@cisco.com> writes:
There is no reason to send one e-mail to both gcc-help@gcc.gnu.org and
gcc@gcc.gnu.org. This message is more appropriate for gcc-help.
Thanks.
> a) What is the default for gcc regarding "pack" or "unpack" data structures?
If I understand your question correctly, the answer is that gcc
normally does not pack data structures. It normally aligns members of
data structures on their natural alignment, which leads to more
efficient code.
> b) Is there a compiler flag for gcc compiler that will pack all data
> structures?
Yes, -fpack-struct.
Ian