[cxx-abi-dev] Tail padding, in sumary

Nathan Sidwell nathan at acm.org
Fri Aug 23 18:28:16 UTC 2002


Mark Mitchell wrote:
> 
> > You haven't mentioned
> >       struct A { virtual void f(); int i : 3; };
> >       struct C { A a; int j: 2; };
> > which should have the same layout as B. g++, intel & hp get this wrong.
> 
> I'm sorry; I didn't understand that to be the case.
> 
> Intel, HP -- would you please confirm that your compilers pack C::j into
> the same byte as A::i in this case?
No they're not doing that. All compilers report sizeof C as 12 bytes,
leading me to believe they are packing j into bits 0,1 of byte 8.
(Rather than bits 0,1 of byte 5.)

nathan
-- 
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
           The voices in my head told me to say this
nathan at acm.org  http://www.cs.bris.ac.uk/~nathan/  nathan at cs.bris.ac.uk



More information about the cxx-abi-dev mailing list