Bug 20627 – Module ctors / dtors should always have D linkage
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-03-03T05:50:12Z
Last change time
2020-03-05T05:20:32Z
Keywords
pull
Assigned to
No Owner
Creator
Mathias LANG
Comments
Comment #0 by pro.mathias.lang — 2020-03-03T05:50:12Z
The following code:
```
module oops;
extern(C):
shared static this ()
{
// Do stuff
}
```
Will emit the shared module constructor as `_sharedStaticDtor_L4_C1`.
Should another module have a similar definition, those functions would conflict.
There is no reason for module constructors / destructors to have C linkage, and its potential for symbol conflict means it should be deprecated.
Comment #1 by dlang-bot — 2020-03-03T07:40:44Z
@Geod24 created dlang/dmd pull request #10858 "Fix issue 20627: Module ctors / dtors should always have D linkage" fixing this issue:
- Fix issue 20627: Module ctors / dtors should always have D linkage
See the changelog for the rationale of this change (or the issue).
https://github.com/dlang/dmd/pull/10858
Comment #2 by dlang-bot — 2020-03-05T04:21:03Z
@Geod24 updated dlang/dmd pull request #10834 "Fix issue 20607 - Module constructors are visible as regular function" fixing this issue:
- Fix issue 20627: Module ctors / dtors should always have D linkage
See the changelog for the rationale of this change (or the issue).
https://github.com/dlang/dmd/pull/10834
Comment #3 by dlang-bot — 2020-03-05T05:20:32Z
dlang/dmd pull request #10858 "Fix issue 20627: Module ctors / dtors should always have D linkage" was merged into master:
- 786fdf10317b25ed5b85ae07e918dc5627b7ab27 by Geod24:
Fix issue 20627: Module ctors / dtors should always have D linkage
See the changelog for the rationale of this change (or the issue).
https://github.com/dlang/dmd/pull/10858