[Dune] C++98/C++11 ABI compatibility in GCC

Christoph GrĂ¼ninger christoph.grueninger at iws.uni-stuttgart.de
Fri Jun 1 09:38:18 CEST 2012


Hi,
maybe you this already, but I was a bit surprised. According to [0,1] it 
is dangerous to link C++ objects which are compiled with and without 
-std=c++11/-std=c++0x. Citing [1]:

"The C++98 language is ABI-compatible with the C++11 language, but 
several places in the library break compatibility. This makes it 
dangerous to link C++98 objects with C++11 objects. If you can recompile 
your code in matching versions of the language, you should do that."

In [0] is a simple example using std::pair which can give both false 
results and segmentation faults.

We should think about that and advice our users to compile external 
libraries with the same std flag as Dune. I never knowingly compiled UG 
or ALUGrid with the C++11 flags.

What do you think about it?

Regards,
Christoph

[0] http://gcc.gnu.org/ml/gcc/2012-05/msg00409.html
[1] http://gcc.gnu.org/wiki/Cxx11AbiCompatibility

-- 
I find that when someone's taking time to do something right in the
present, they're a perfectionist with no ability to prioritize, whereas
when someone took time to do something right in the past, they're a
master artisan of great foresight.         -- Randall Munroe, xkcd #974




More information about the Dune mailing list