3

And if not, what things are incompatible?

Assume that both use the same standard library implementation (for example, libstdc++).

frp
  • 1,119
  • 1
  • 10
  • 30
  • 2
    Doesn't [this](http://stackoverflow.com/a/11274684/985296) provide an answer to your question? – stefan May 15 '14 at 20:32
  • 3
    I don't think they are. Different compiler implementions ususally introduce different ABI's. Though I'm not sure at all, interesting question ... – πάντα ῥεῖ May 15 '14 at 20:33
  • What does "binary compatible" mean, anyway? The C ABI is practically universal, but beyond that... – Rook May 15 '14 at 20:33
  • @stefan That answer is from 2012, the fundamental facts might have changed since then. – cmaster - reinstate monica May 15 '14 at 20:34
  • @cmaster: Then the answers should be updated (or at least dated). New posts should still be closed as duplicates. – Mooing Duck May 15 '14 at 20:35
  • @cmaster Then it should be updated. But that also answers it in a way: If you can't be sure that things don't change across different versions of one compiler, you can never rely on two different compilers being compatible – stefan May 15 '14 at 20:35
  • I talk about C++ ABI (name mangling, rtti, exceptions, vtables and so on). It is said in documentation that C ABI is compatible, but I don't know if C++ is. – frp May 15 '14 at 20:38
  • You should assume it is not ABI compatible. – juanchopanza May 15 '14 at 20:43
  • clang++ links with g++ compiled libraries (on x86-64 linux, at least) in general. But I'm sure it's possible to find bugs - like with any large compiler implementation. – Mats Petersson May 15 '14 at 21:23

0 Answers0