Date: Tue, 3 Jun 2025 12:02:31 +0200
Hi Thomas,
so you say, it is possible to do with all platforms and compilers.
However, MSVC has some undocumented stuff, which has/had to be reverse-engineered.
But it is possible.
If those facilities are useful, why not write a proposal for functions in the standard.
The implementation would be done by the implementers, no need for documenting or reverse-engineering the ABI or possible UB, when done manually.
It is enough that it can be done on each major platform.
The standard only has to specify the high-level behaviour of new functions.
It was important to know that it can be done with MSVC.
But the code to do it, would not have to be part of a proposal, it can just be a link to a repository mentioning implementability was tried out.
The more important question is, if that facility is useful, and it would lead to good code.
If you do not know, what types an object can be, should it be convertable into a pointer to the most-derived object?
Best,
Sebastian
-----Ursprüngliche Nachricht-----
Von:Frederick Virchanza Gotham via Std-Proposals <std-proposals_at_[hidden]>
Gesendet:Di 03.06.2025 11:30
Betreff:Re: [std-proposals] Standard support for different ABI‘s for class vtables
An:std-proposals_at_[hidden];
CC:Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>;
On Tue, Jun 3, 2025 at 2:00 AM Oliver Hunt wrote:
>
> Here’s what happens when you aren’t compiling for x86_64:
>
> Address of stringstream: 0x16efeaf18
>
> Address of ostream: 0x16efeaf28
>
> [1] 74787 bus error ./a.out
I presume that machine you're working on is 64-Bit ARM using the
aarch64 instruction set?
Here's what you need:
https://godbolt.org/z/aaMjfvbro
I can do this for every compiler, every operating system, every
instruction set, every CPU. Including when pointer authentication
comes out for Linux. The only one that takes a little more work is
Microsoft, hence my idea of 'std::polyhandle'.
That GodBolt I gave you just now has no undefined behaviour on 64-Bit ARM.
--
Std-Proposals mailing list
Std-Proposals_at_[hidden]
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
Received on 2025-06-03 10:10:29