[cxx-abi-dev] Question about tail padding

Nathan Sidwell nathan at codesourcery.com
Thu Aug 22 17:16:27 UTC 2002


Mark Mitchell wrote:

> > This is a different problem to the one Mark brought up.
> 
> It is?
I've lost context, and I think what I wrote was badly worded.
IIRC it is the same nvsize issue you brought up, but a different case.
Your case g++ & hp got right, intel got wrong. this case g++ gets
wrong (hp & intel are untested).

There's also an issue with bitfields that popped up. I think the ABI
doc is 'vague' and g++ does inconsistent things

something like
	struct A { virtual ~A();
		  int a : 2;};
	struct B : A { int b  :2;};
	struct C { A a; int c : 2;};
where should B::b and C::c be allocated? in a new allocation unit
or in the next 2 bits of the same unit that A::a is in? The abi
says 'if the preceeding byte is partially filled by a bitfield'

g++ 3.2 reports (i686)
A 8 bytes
B 8 bytes
C 12 bytes

B & C should have the same layout AFAICT from the ABI.

nathan

-- 
Dr Nathan Sidwell   ::   http://www.codesourcery.com   ::   CodeSourcery LLC
         'But that's a lie.' - 'Yes it is. What's your point?'
nathan at codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan at acm.org



More information about the cxx-abi-dev mailing list