Bug 1278 – Header generation option omits module ctors. Causes out of order module init.

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2007-06-18T22:12:00Z
Last change time
2014-02-16T15:24:21Z
Keywords
wrong-code
Assigned to
bugzilla
Creator
sean

Comments

Comment #0 by sean — 2007-06-18T22:12:08Z
Some of the runtime modules in Tango have their public import file generated using the -H option. Currently, if these modules are used in the static ctor of a user application, an error may occur because the user modules will be initialized before the imported (Tango) modules. This causes a divide by zero error in the case of fibers.
Comment #1 by sean — 2007-06-18T22:20:19Z
Oops. This is a dup of issue #668. Please fix. It's as easy as adding a "static this();" to the header output of modules containing static ctors. *** This bug has been marked as a duplicate of 668 ***