A-25 Bitfields of greater than field size

Matt Austern austern at isolde.engr.sgi.com
Tue Feb 15 17:48:59 UTC 2000


On Feb 14,  4:44pm, Jim Dehnert wrote:
> Subject: Re: A-25 Bitfields of greater than field size
> > From: Jason Merrill <jason at cygnus.com>
> > Date: 10 Feb 2000 12:43:55 -0800
> >
> > It seems to me that
> >
> > struct A {
> >   ...
> >   signed char c: 32;
> >   ...
> > };
> >
> > should be treated like
> >
> > struct A {
> >   ...
> >   int i: 32;
> >   ...
> > };
> >
> > except that only the low 8 bits are significant.  This should be true
> > whether or not there is actually a 32-bit type on the target.
>
> In fact, I had been thinking that IF the primary purpose of this feature
> is to allow known layout of (something like) an enum type without
> knowing how big the compiler will make it, then Jason is right.

Based on conversation with Mike Ball, I believe that the primary
purpose of the feature was that it was easier to allow it than
to forbid it.  I don't think it was intended for any specific
purpose, and I don't think users have any expectations.  We may
as well do whatever is easier for us.

			--Matt







More information about the cxx-abi-dev mailing list