On 18 June 2012 08:52, Stephan Bergmann <sberg...@redhat.com> wrote: > On 06/15/2012 10:12 PM, James Y Knight wrote: >> >> Whether or not this particular incompatibility was intended or not, the >> point remains. You cannot say that GCC devs are taking the C++11 binary >> incompatibility issue seriously while: >> a) there exist serious ABI incompatibilities between the modes. >> b) there is essentially no notice to users about the problem (and lots of >> users already brokenly compiling in C++11 mode!) >> c) there are no recommendations or plans for how users and distros are >> expected to deal with the issue. > > > Trying to understand what the status quo (in GCC 4.7) is exactly: The > source of libstdc++ contains code conditional on __GXX_EXPERIMENTAL_CXX0X__ > (to differentiate -std=c++11 from -std=c++98 behavior), but such conditional > code happens to remain confined to "inline-only" header code for now.
There is some non-header-only code compiled into libstdc++.so which uses -std=c++11, but it's for new classes or functions such as std::thread or the std::fstream::fstream(const std::string&) constructor which are only defined when -std=c++11 is used. i.e. there's only one version of that code and it's not even declared in the headers without __GXX_EXPERIMENTAL_CXX0X__. Conditional code where something is defined in both c++98 and c++11 mode, but the definitions are incompatible, is confined to headers. > Therefore, a single version of libstdc++.so.6 is enough for both -std=c++11 > and -std=c++98 applications (without needing to resort to additional tricks > in the implementation of libstdc++). Is that right? Yes. The problems arise when user code that uses the "inline-only" code is linked to other user-code that has a different definition of that inline-only code.