fully qualifed IR names causes problems of mismatched definitions

Basile B. b2.temp at gmx.com
Thu Sep 30 17:39:43 UTC 2021


On Thursday, 30 September 2021 at 06:04:46 UTC, kinke wrote:
> On Wednesday, 29 September 2021 at 23:53:44 UTC, Basile B. 
> wrote:
>> too bad for me, firstly detected in 2016 so probably hard to 
>> fix.
>
> It's not trivial to fix, but the main reason is that users 
> shouldn't declare structs in different modules and expect them 
> to somehow be magically folded so a single common type 
> (`extern(C)` has no effect in this regard). Opaque declarations 
> are no exception.
>
> You can work around it for the time being by compiling each 
> module to a separate object file - e.g., by creating a static 
> lib via -lib, or compiling with -c (without -of) and then 
> linking manually.

Yet extern(C) functions dont seem to have this problem, but 
anyway,
I'll just cheat on LDC the time to finish the translation.

thx again for the explanations.


More information about the digitalmars-d-ldc mailing list