[Issue 22367] The __ModuleInfo member spuriously linked for modules compiler with -betterC

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Nov 30 21:06:09 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=22367

--- Comment #12 from Richard Cattermole <alphaglosined at gmail.com> ---
D module constructors of course shouldn't work in -betterC code. They can throw
a warning as dead code and hence don't require ModuleInfo to be generated (this
should be easy to resolve). That'll prevent surprises in the future.

However, the fundamental problem here is with pay-as-you-go runtime. You can't
turn on ModuleInfo when you need it in -betterC to move you into pay-as-you-go
area of the scale.

We can't turn on ModuleInfo generation right now, because DllImport is
incomplete (a good bit harder to implement). If we did turn it on right now, it
would result in segfaults if you have D DLL's with D with the runtime
executable.

I am arguing that instead of fixing this bug, we solve the DllImport issues
first and use code like this as test cases to verify that it is indeed fixed.

--


More information about the Digitalmars-d-bugs mailing list