This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: attribute "unpadded"


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~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]