[Issue 17747] extern(C) shared static module constructor should be called in betterC programs

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Aug 27 02:34:56 PDT 2017


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

--- Comment #4 from ZombineDev <petar.p.kirov at gmail.com> ---
> __attribute__ ((constructor)) is in C. It can be called in start before main, without DRuntime.

Technically this is a compiler extension, not a feature part of the ISO C
standard. My point was that C standard does not require such feature and
therefore we shouldn't rely on its existence.

On the other hand, C++ does due to the need to be able to call class
constructors for static/global variables.

--


More information about the Digitalmars-d-bugs mailing list