extern(C) names are being mangled; that's crazy, Walter says I'm crazy

Aliak something at something.com
Thu Jul 25 08:19:46 UTC 2019


On Thursday, 25 July 2019 at 00:24:11 UTC, Jonathan Marler wrote:
> On Wednesday, 24 July 2019 at 09:56:50 UTC, Manu wrote:
>> [...]
>
> You're not crazy.  Walter can bey hard to discuss things with.  
> I think he's tired of discussing things after so many years.  
> He tends to ignore most things and only responds to what he 
> thinks is important.   If you're feeling burnt out, imagine how 
> he feels after all the years he's been doing this.
>
> But know that you're not the only one who feels this way, and 
> Walter tends to have a very different viewpoint on things.  So 
> don't take it personally, just because he disagrees with you 
> doesn't mean you're wrong.
>
> As for this subject, I expect extern (C) to change both the API 
> and the mangling, so I would expect the behavior described by 
> Manu.  However, I can see use cases for only changing the ABI 
> while keeping mangling.  It is very weird that extern (C) 
> affects both in normal code, and only the ABI when it's inside 
> a mixin template.  Sounds like one of those very odd cases in 
> C++ that Scott Meyers would put on one of his slides :)
>
> Dconf 2014 Day 2 Keynote: The Last Thing D Needs -- Scott Meyers
> https://www.youtube.com/watch?v=KAWA1DuvCnQ
>
> After reading the thread and thinking on a bit, it seems like 
> it would be simpler to have extern (C) do the same thing in all 
> cases, which would be to change the ABI and the mangling.  If 
> you want D mangling, use mangle(D) or something along with 
> extern (C).

Ok, I think after reading this and the bug report, and the 
mentioned uses cases, the callback case is the one that should be 
treated differently, and not the vanilla case. So mangle(D) and 
extern(C) if you want mangling to be different for a C function 
makes things consistent and expected.


More information about the Digitalmars-d mailing list