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