[Issue 17035] extern(C) and extern(C++) module ctor/dtor should behave like the C init/fini functions

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Dec 28 07:07:53 PST 2016


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

David Nadlinger <code at klickverbot.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |code at klickverbot.at

--- Comment #1 from David Nadlinger <code at klickverbot.at> ---
LDC has been supporting this for a while with a compiler-specific pragma:
https://wiki.dlang.org/LDC-specific_language_changes#LDC_global_crt_ctor_and_LDC_global_crt_dtor

Tying this to extern(C)/extern(C++) might look nicer syntactically, although
I'm not sure about conflating what usually concerns ABI (in the wider sense)
with runtime behaviour. Either way, since it is quite a sharp tool (no
guarantees about runtime/GC initialisation), we should make sure to handle
deprecation properly – "extern(C):" and "shared static this" (order!) might
already be used in the same file and would change meaning.

--


More information about the Digitalmars-d-bugs mailing list