packed, aligned

Mike Stump mrs@windriver.com
Tue Feb 13 17:39:00 GMT 2001


> To: Dennis Bjorklund <db@zigo.dhs.org>
> Cc: <gcc@gcc.gnu.org>
> From: Graham Murray <graham@gmurray.org.uk>
> Date: 11 Feb 2001 11:20:26 +0000

> Dennis Bjorklund <db@zigo.dhs.org> writes:

> > Why would someone want to pack a struct and still have some padding in the
> > end?

> So that in an array of structures, each structure starts on an
> appropriate boundary. 

And byte aligned structures need only byte aligned boundaries, which
means zero padding.  All structures can be changed to be byte aligned
by the addition of attributes.



More information about the Gcc mailing list