Creating weak symbols with D

kinke noone at nowhere.com
Sat Aug 8 18:39:53 UTC 2020


On Saturday, 8 August 2020 at 18:14:34 UTC, Stefan Koch wrote:
> On Saturday, 8 August 2020 at 17:59:08 UTC, Andrei Alexandrescu 
> wrote:
>> Weak symbols (https://en.wikipedia.org/wiki/Weak_symbol) are 
>> not often needed, but they are, they're needed badly.
>>
>> C and C++ define __attribute__((weak)) to introduce weak 
>> symbols. It would be great if D could have a corresponding 
>> @weak attribute.

LDC has @weak, even working for MSVC targets since v1.22.

> Out of interested where do you find yourself needing to specify 
> weak linkage?

E.g., 
https://github.com/ldc-developers/druntime/commit/2eee5ffb17ff15fab20fa18b85bb6a696b7a2213.


More information about the Digitalmars-d mailing list