Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does using -std=c++11 break binary compatibility?

Tags:

c++

c++11

g++

I've looked hard for this question - it seems an obvious one to ask - but I haven't found it: Is a module compiled with "-std=c++11" (g++) binary compatible with modules that are not compiled with the option? (That is, can I link them together safely?) Both compilations would use the exact same version of g++.

To be more precise, using gcc 4.9.0, can I only use the "-std=c++11" on specific compilation units and then let the others compile without the option.

like image 994
John Avatar asked May 26 '14 16:05

John


1 Answers

An authoritative reference can be found in gcc's C++11 ABI Compatibility page.

The short summary is: the are no language reasons the ABI gets broken but there are a number of mandated changes which cause the standard C++ library shipping with gcc to change.

like image 50
Dietmar Kühl Avatar answered Sep 29 '22 06:09

Dietmar Kühl