Bug 11191 – Runtime.args may be called before set

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
druntime
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2013-10-07T12:31:00Z
Last change time
2013-10-08T09:48:19Z
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2013-10-07T12:31:41Z
Because initialization moved to C's .ctors/.dtors the runtime calls module ctors before main. The global _d_args variable is only initialized in main so calling Runtime.args earlier will return an empty array.
Comment #1 by andrej.mitrovich — 2013-10-07T12:32:54Z
Comment #2 by code — 2013-10-08T09:48:19Z
*** This issue has been marked as a duplicate of issue 11149 ***