Date: Mon, 02 Jun 2025 18:55:54 -0300
On Sunday, 1 June 2025 23:52:34 Brasilia Standard Time Oliver Hunt wrote:
> > The platform ABI does not include C++. The processor-specific ABI (psABI)
> > for each OS only covers calling sequence and standard types. The C++ ABI
> > comes on top and it has a psABI portion for some low-level details.
>
> By definition the *platform* defines the C++ ABI.
Again, no. By convention, it does not and never has, not in the 30 years C++
compilers have existed. No OS officially endorses such a document. It just
happens that most OSes have a de facto C++ ABI because the only compilers
targeting them obey the same, common C++ ABI. It just appears there are official
C++ ABIs because the OSes where differing ABIs existed have become obsolete,
except for Windows.
More importantly, if a platform wanted to define an ABI, it would need to
publish a document explaining how to implement it, which Microsoft never has.
Because of that, Windows definitely does not have a platform C++ standard. One
*cannot* implement against the MSVC ABI because it is undocumented and has
quirks only discoverable through trial and error.
> if the platform says “this is the ABI for calling a polymorphic function”
> that is the ABI for calling a polymorphic function.
Agreed. But Windows does not say that.
> > The platform ABI does not include C++. The processor-specific ABI (psABI)
> > for each OS only covers calling sequence and standard types. The C++ ABI
> > comes on top and it has a psABI portion for some low-level details.
>
> By definition the *platform* defines the C++ ABI.
Again, no. By convention, it does not and never has, not in the 30 years C++
compilers have existed. No OS officially endorses such a document. It just
happens that most OSes have a de facto C++ ABI because the only compilers
targeting them obey the same, common C++ ABI. It just appears there are official
C++ ABIs because the OSes where differing ABIs existed have become obsolete,
except for Windows.
More importantly, if a platform wanted to define an ABI, it would need to
publish a document explaining how to implement it, which Microsoft never has.
Because of that, Windows definitely does not have a platform C++ standard. One
*cannot* implement against the MSVC ABI because it is undocumented and has
quirks only discoverable through trial and error.
> if the platform says “this is the ABI for calling a polymorphic function”
> that is the ABI for calling a polymorphic function.
Agreed. But Windows does not say that.
-- Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org Principal Engineer - Intel Platform & System Engineering
Received on 2025-06-02 21:56:04