This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [RFC] C++1x breaking the ABI in one more place :(
On 20 May 2010, at 17:38, Mark Mitchell wrote:
> Ian Lance Taylor wrote:
>
>> If I understand C++0x inline namespaces, it does seem that they could
>> be used for that purpose. It would mean that the new class would have
>> a longer mangled name, but so it goes. But it also seems like C++0x
>> inline namespaces have an effect similar to that of the existing GNU
>> extension of strong namespaces. Is there any reason we could not use
>> that today to introduce ABI breaking versions of classes?
>
> The problem of making it possible for app1 (old ABI) and app2 (new ABI)
> to both use the same libstdc++.so might be solved via inline namespaces.
>
> But the harder problem is the following scenario:
>
> * libstdc++ defines a class C, whose ABI is now changing
>
> * libfoo.so depends on libstdc++.so and uses the old version of C
>
> * main.c creates objects of class C (using the new definition of C) and
> passes them to functions in libfoo.so
It wouldn't fix the problem. It would however lead to libfoo.so and main.c not linking, rather than the current unpredictable run-time crash.
Chris