[Bug d/94623] ice for ./gdc.test/compilable/interpret3.d
ibuclaw at gdcproject dot org
gcc-bugzilla@gcc.gnu.org
Tue Apr 21 09:59:20 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94623
--- Comment #24 from Iain Buclaw <ibuclaw at gdcproject dot org> ---
(In reply to David Binderman from comment #23)
>
> Worse than that ?
>
> It is silently linking with the wrong set of files and producing run time
> errors.
>
> Maybe it would be a good idea to put some code into the linkage process
> to make sure linkage only occurs with files the compiler knows about.
Modules are not pre-compiled (unlike Go/C++/Fortran?).
The only scenario to consider really is the following:
gdc: module std.example; int myfunction(int a) pure nothrow {...}
ldc: module std.example; int myfunction(int a) pure nothrow @safe {...}
If the wrong module is imported, when linking, you'll get a linker error:
undefined reference to 'myfunction(int) pure nothrow @safe'
As the '@safe' attribute is encoded in the mangled symbol, and that doesn't
exist in gdc's libgphobos.a/so
More information about the Gcc-bugs
mailing list