RFC: attribute "unpadded"
Richard Henderson
rth@redhat.com
Thu Aug 29 15:24:00 GMT 2002
On Thu, Aug 29, 2002 at 03:10:15PM -0700, Richard Henderson wrote:
> Perhaps you could elaborate further on the distinction here?
I just thought of one other thing. Please tell me what
is supposed to happen with
struct A { virtual void foo(); int x : 31; };
struct B : public A { unsigned int x : 1; };
If sizeof(B) == 8, then I don't see that "unpadded" does
you any good. Having
struct B { struct A __base; unsigned int x : 1; };
somehow use the leftover bits of A would, IMO, do extreme
violence to gcc's structure layout routines.
If sizeof(B) == 8, then I think you're much better off modeling
this by including members directly, as I discussed earlier.
r~
More information about the Gcc
mailing list