[Issue 21623] New: pragma(crt_constructor) should accept function declarations
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Feb 9 08:28:43 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=21623
Issue ID: 21623
Summary: pragma(crt_constructor) should accept function
declarations
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: bugzilla at digitalmars.com
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.
--
More information about the Digitalmars-d-bugs
mailing list