[Issue 22839] Add equivalent of C 'static' for symbols

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 5 10:01:54 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=22839

--- Comment #2 from Dennis <dkorpel at live.nl> ---
(In reply to Walter Bright from comment #1)
> This would be a significant change in behavior.

I don't want to change templates or 'normal' extern(D) functions, it's only for
niche -betterC purposes.

> This hasn't come up before, so I'd like to see a compelling use case to make
> a language change?

The use case is: I have a C to D translator, and it doesn't know what to do
with `static` declarations. It translates to `private`, but that still results
in symbol clashes sometimes (like a library defining a static function
`terminate`, which was also defined in a Windows DLL IIRC).

It's not supposed to be a big language change, it could even be a compiler
extension similar to LDC's `pragma(LDC_no_moduleinfo)` and
`pragma(LDC_no_typeinfo)`
(https://wiki.dlang.org/LDC-specific_language_changes), though I'd like all
compilers to use the same syntax for it of course.

--


More information about the Digitalmars-d-bugs mailing list