Bug 21623 – pragma(crt_constructor) should accept function declarations

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-02-09T08:28:43Z
Last change time
2024-12-13T19:14:37Z
Assigned to
No Owner
Creator
Walter Bright
See also
https://issues.dlang.org/show_bug.cgi?id=21620, https://issues.dlang.org/show_bug.cgi?id=21621, https://issues.dlang.org/show_bug.cgi?id=21622, https://issues.dlang.org/show_bug.cgi?id=23535
Moved to GitHub: dmd#19870 →

Comments

Comment #0 by bugzilla — 2021-02-09T08:28:43Z
Consider: extern (C) pragma(crt_constructor) void foo(); This code silently compiles, but does nothing, while: extern (C) pragma(crt_constructor) void foo() { } compiles and calls foo() on startup. There is no reason the former should not work, and to silently do nothing at minimum is a bug.
Comment #1 by robert.schadek — 2024-12-13T19:14:37Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19870 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB