On Thursday 31 of May 2012 22:58:32 Jonathan Wakely wrote: > On 31 May 2012 22:39, Jonathan Wakely wrote: > > On 31 May 2012 22:35, James Y Knight wrote: > >> I understand that the ABI changes generally cannot be avoided, but a lot > >> of pain for a lot of people could be avoided by making things fail > >> obviously with a link error, instead of sometimes, arbitrarily, if you're > >> lucky, you'll get a segfault at runtime. > > > > Do you have any suggestions for how to do that? > > ... *without* breaking the current ABI, because if we weren't trying > to keep it stable it would be much easier. > > If you want to you can configure with > --enable-symvers=gnu-versioned-namespace and test that mode, which > would allow everything to be put in something like std::__cxx2011::__8 > for -std=c++11 mode, but AFAICT only one person seems to be trying > that option out and giving feedback on it.
the versioned namespace doesn't solve all problems. if you put c++11/std::list in the e.g., std::__8 namespace then you trig a nice linker error for incompatible objects that passes std::list as a function argument but std::list used as a return type won't be catched (return type is not mangled in function symbol). from the others side, someone can use -frecord-gcc-switches to detect mixed '-std=...' after final linking and report error in such cases.