3 ms·
No, ABI is not part of the C++ standard, although there are parts of C++ that do go "this is an ABI thing" (e.g., [[no_unique_address]]). ABI is more of OS-lev
by jcranmer 2mo ago
No, ABI is not part of the C++ standard, although there are parts of C++ that do go "this is an ABI thing" (e.g., [[no_unique_address]]).
ABI is more of OS-level thing. Most systems these days follow the SysV ABI, which is largely defined by the hardware manufacturers via the processor-specific supplements (the x86-64 one is here: https://gitlab.com/x86-psABIs/x86-64-ABI https://gitlab.com/x86-psABIs/x86-64-ABI). These largely delegate C++-specific conventions to the Itanium C++ ABI (which they likely directly reference), although the ARM ecosystem uses a somewhat different layout for the exception handling tables. Microsoft uses a different ABI for both the underlying C ABI and for the C++ compatibility layer built on top of the C ABI.
One of the issues that crops up is that vendors end up needing to add extensions to the ABI for various reasons, and these extensions tend to end up being incompatible, since they're added before they've had a time to be standardized. 16-bit floats is a particular historical bugbear, as is the C23 _BitInt stuff.
- jdw64 2mo agoThank you for the kind comment. I'll make a note of it and look into it.
- rramadass 2mo agoOne more addition. There is often a distinction made between "language ABI" and "library ABI" in documentation which is highly confusing. The answer is: library API + compiler ABI = library ABI GNU libstdc++ ABI Policy and Guidelines - https://gcc.gnu.org/onlinedocs/gcc-9.2.0/libstdc++/manual/manual/abi.html https://gcc.gnu.org/onlinedocs/gcc-9.2.0/libstdc++/manual/ma...