logoalt Hacker News

Thoroughly Understanding C++ ABI

21 pointsby rramadasslast Sunday at 2:58 PM19 commentsview on HN

Comments

Dwedittoday at 2:29 PM

C++ ABIs are why Win32 settled on things like COM to do cross-module passing of objects. Because nobody could agree on a standard, the COM standard enforced a very specific calling convention, and a very specific vtable layout for COM objects.

show 2 replies
rramadasslast Monday at 2:59 AM

GNU libstdc++ "Dual ABI" issue - https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_a...

show 1 reply
rramadasslast Sunday at 3:09 PM

As always, read wikipedia and follow links as needed - https://en.wikipedia.org/wiki/Application_binary_interface

mohamedkoubaatoday at 3:08 PM

C++ famously has no ABI, it is the implementations of C++ that have ABIs. The reason the situation is so bad is that it's considered explicitly out of scope of the language (it targets an abstract machine).

show 1 reply
jdw64today at 2:35 PM

Does the C++ standard guarantee binary ABI? Isn't that something that compiler and library contributors handle separately? So I think the arguments you see online are more accurate—vendors are the ones maintaining it.

In other words, the ABI we rely on today isn't really part of the C+ standard—it's more like the Itnaium C++ ABI or the MSVC C++ ABI.

In the end, I think the ABI stays stable because of community conventions established by compiler vendors.

show 4 replies