[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: C++ symbol mangling difference between arches



On Fri, Jun 26, 2009 at 04:34:00PM +0300, Modestas Vainius wrote:
[...]
> 2b) Still 2a is not enough if the base class contains such data members like 
> (s)size_t (on s390) or qreal (on armel). To support such cases, vt can only be 
> a complex expression with recursive subst expansion like 
> vt=size_t*2+ptr*2+qreal+4. But do we want this? The alternative would be to 
> maintain such symbols (like destructors) as arch specific.
 
Also there are differences in alignment requirements between 32-bit
architectures.  For example i386 aligns 64-bit types on 32-bit boundaries
whereas armel aligns them on 64-bit boundaries.

> If I understand correncly, this adjustment is only needed in case of multiple 
> inheritance only for virtual functions of the same name which are in multiple 
> base classes and they are overriden in the derived class.

The virtual function name has nothing to do with it.  The adjustment is
needed whenever instances of the base class that first defined the
virtual function are not the first sub-object in instances of the
derived class.

> Unfortunately, virtual destructors satisfy those conditions in any case of
> multiple inheritance and good style of C++ programming :/ So this issue is
> important.
> 
> So which way to choose: 2a or 2b or another?
[...]

Would it be possible to implement expansion to a regexp instead of to a
string that must exactly match?

Ben.

-- 
Ben Hutchings
73.46% of all statistics are made up.


Reply to: