Date: Fri, 21 Mar 2025 08:17:15 -0700
On Friday, 21 March 2025 01:14:06 Pacific Daylight Time Hans Ã…berg wrote:
> > I don't think so. I don't see the point of this in the Standard Library.
>
> It is for compiler writers who put in options for language versions without
> full support.
>
> This is what the example I gave is about.
But you haven't explained why the Standard should use this instead of what
they currently do now.
> > It will fail to link. Therefore, it requires work.
>
> The very point is to make is to be able to make a workaround that is
> automatically disabled when the genuine version arrives
That's called a weak symbol and is not supported in all platforms.
Moreover, not even a weak symbol would work. Another thing that is missing is
what happens when the previously unimplemented function does become
implemented. Then there are no markings to differentiate the vendor's from
yours. This is now a plain ODR violation.
No, what you want is [[gnu::weak]] in the copy that should be discarded. And
accept this won't work on Windows.
> > I don't think so. I don't see the point of this in the Standard Library.
>
> It is for compiler writers who put in options for language versions without
> full support.
>
> This is what the example I gave is about.
But you haven't explained why the Standard should use this instead of what
they currently do now.
> > It will fail to link. Therefore, it requires work.
>
> The very point is to make is to be able to make a workaround that is
> automatically disabled when the genuine version arrives
That's called a weak symbol and is not supported in all platforms.
Moreover, not even a weak symbol would work. Another thing that is missing is
what happens when the previously unimplemented function does become
implemented. Then there are no markings to differentiate the vendor's from
yours. This is now a plain ODR violation.
No, what you want is [[gnu::weak]] in the copy that should be discarded. And
accept this won't work on Windows.
-- Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org Principal Engineer - Intel DCAI Platform & System Engineering
Received on 2025-03-21 15:17:21