extern(C) in druntime

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Mon Nov 10 08:59:45 PST 2014


On Monday, 10 November 2014 at 16:28:11 UTC, Sean Kelly wrote:
>> I think Sean's point is that is another historical reason why 
>> we used extern(C), back when pragma(mangle) didn't exist.
>
> Yep.
>
> Since some D types don't exist in C and so have to be passed 
> differently by convention (static arrays), I think an argument 
> could be made that we should assume that anything behind an 
> extern (C) interface is in fact C code.  But that's not how 
> it's treated today, where extern (C) is simply another calling 
> convention.

This was exactly what I was proposing in 
https://issues.dlang.org/show_bug.cgi?id=8887 (with possibly 
making any differences compile-time error initially for soft 
transition)

Right now question is, however, are there any legitimate uses of 
`extern(C)` in druntime or those all can be replaced with 
`pragma(mangle, "XXX") extern(D)`?


More information about the Digitalmars-d mailing list