This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: Dealing with C++98/11 ABI incompatibilities


On Tuesday 03 of July 2012 15:18:34 Jason Merrill wrote:
> There seem to be two areas of concern with compatibility between the 
> C++98 and C++11 ABIs:
> 
> 1) Changes to member function return types, as with std::complex.  For 
> these, the two functions could coexist except that they are mangled the 
> same way.  So I propose that we introduce a mechanism to change the 
> mangled name of a member function.  Unlike with attribute ((alias)), the 
> declared name would only be visible at the source level, not in the 
> assembly output.
> 
> My inclination is to just have a single declaration and have an 
> attribute to change its name for linkage purposes.
> 
> In the passed we have discussed using inline namespaces to do this sort 
> of renaming, but that doesn't help with individual member functions 
> within a class, like the situation in std::complex.
> 
> 2) Object layout changes to std::list and std::basic_string.  For these 
> types, there is no way to both retain backward compatibility with older 
> C++98 code and conform to the C++11 standard.  The best we can hope for 
> is to allow old code to coexist with new code so long as they don't try 
> to touch the same string/list objects.

Hi,

i'm wondering if we could forward inline list<T>::size() from template (headers)
to some 'std::size_t& size()' implementation (.cpp) details, provide std::__{7,8}
exports for c++98/11 and switch to gnu-versioned-namespace (.so.7) by default?

old '98 binaries linked with .so.6 will use inlined size() based on advance().
new '98/'11 binaries will call size() from correct libstdc++.so.7 namespace.
broken intermediate binaries keep broken.

BR,
PaweÅ.


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