Wrong module initialization order when building with Dub on Windows?

Jacob Carlborg doob at me.com
Tue Oct 2 18:58:16 UTC 2018


On 2018-10-02 08:49, bauss wrote:

> Honestly I would say that it should have worked regardless of the module 
> order, because it's the runtime arguments.
> 
> Basically D's runtime should set them before ANY module constructors are 
> called and most definitely before the main function is called.

They are set before calling any module constructors. The arguments are 
set here [1] and the module constructors are run here [2].

[1] 
https://github.com/dlang/druntime/blob/e807e29472fa5973c438f97cd5d4b390ef1a4a5c/src/rt/dmain2.d#L438

[2] 
https://github.com/dlang/druntime/blob/e807e29472fa5973c438f97cd5d4b390ef1a4a5c/src/rt/dmain2.d#L493

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list