C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Standard support for different ABI's for class vtables

From: Thiago Macieira <thiago_at_[hidden]>
Date: Fri, 30 May 2025 11:50:33 -0300
On Friday, 30 May 2025 09:31:58 Brasilia Standard Time Frederick Virchanza
Gotham via Std-Proposals wrote:
> It would be really cool if C++29 compilers were expected to have a
> feature whereby they would output an "ABI helper class" for any class
> you specify, like the helper class I've shown about that finds the
> vtable and manually invokes the right method. It would mean that
> different compilers with different ABI's could work together with each
> others' binaries more easily.

This is not a request for the Standard. The Standard doesn't know there are
multiple ABIs in the first place.

But this is a request for a vendor extension, one which I believe Clang could
implement because they do support both ABIs (GCC does not). GCC does support
__attribute__((sysv_abi)) to use the System V calling convention on x86-64
Windows, for example, so there is precedent.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel Platform & System Engineering

Received on 2025-05-30 14:50:38