Thoroughly Understanding C++ ABI (2024)

(ykiko.me)

Comments

Dwedit 17 hours ago
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.
rramadass 2 August 2026
As always, read wikipedia and follow links as needed - https://en.wikipedia.org/wiki/Application_binary_interface
rramadass 3 August 2026
GNU libstdc++ "Dual ABI" issue - https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_a...
jdw64 17 hours ago
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.

jeffbee 15 hours ago
One nice thing to remember is for projects you control, you can dictate the ABI. There isn't a law enforcement bureau that will arrest you for passing parameters in whatever register suits you. You just have to imagine life differently than they did in the 70s when they dreamed up dynamic libraries for reasons that are largely no longer valid.
mohamedkoubaa 16 hours ago
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).