This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Minimum struct size
- To: <gcc at gcc dot gnu dot org>
- Subject: Minimum struct size
- From: "Rob Taylor" <robt at flyingpig dot com>
- Date: Thu, 27 Jul 2000 18:37:58 +0100
I've recently noticed that gcc doesnt allow structs of zero size (it forces
every struct to be at least one byte big). This is currently causing us all
sorts of problems as we often use base classes with no members and worry about
the size of classes (we do embedded systems stuff). What I'm writing to ask is:
does anyone remember why this is the case, and whether it's fixable without
breaking fundamental assumptions? if so I might have a go about fixing it
myself... (NB the standard says 'base class sub objects *may* have zero size')
Thanks,
Rob Taylor
Flying Pig Systems