Why are extern(C/C++) definitions and references mangled differently in separately compiled modules?

Max Samukha maxsamukha at gmail.com
Fri Sep 6 17:42:08 UTC 2019


On Friday, 6 September 2019 at 16:55:31 UTC, Max Samukha wrote:
> On Friday, 6 September 2019 at 15:52:46 UTC, Stefan Koch wrote:

>> If that is happening you hit a bug.
>> It seems unlikely though.
>
> Could you elaborate a bit? How should extern(C/C++) definitions 
> be mangled - fully qualified or not, and why is the reference 
> to extern(C/C++) D-mangled? The spec seems to say nothing about 
> it.

Ok, I have figured it out. There was 'a.di' file along with 'a.d' 
in the same directory, with a definition of extern(D) foo. That 
file was silently imported by the compiler (probably, a bug). 
Thank you for your attention.





More information about the Digitalmars-d-learn mailing list