This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: how to pack data using gcc compiler?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]