Mason <slash....@free.fr> writes:

> Hello everyone,
>
> Consider the following program.

This mailing list is about the development of gcc, for user questions
please use gcc-h...@gcc.gnu.org instead.

> gcc lays out bar2 like this:
> foo2(80) padding(48) i(4) padding(60)

struct foo2 has size 128, not 80.  The padding is part of the type.

> But it seems (to me) that gcc could fit the "int" field in the
> first padding, to save space:
>
> foo2(80) i(4) padding(44)

Structure members cannot overlap.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

Reply via email to