Drop extern (C++)

Walter Bright newshound1 at digitalmars.com
Wed May 12 15:57:54 PDT 2010

dsimcha wrote:
> == Quote from Don (nospam at nospam.com)'s article
>> BLS wrote:
>>> Hi,
>>> I think nearly nobody is using extern (C++) 'cause of it's limits. So
>>> why not drop it ? IMHO this feature is not a " D2 sales argument",
>>> instead it's vs. productive.
>>> What do you think ?
>>> Bjoern
>> There's a much more fundamental problem with it: C++ doesn't support it!
>> You can't compile a file with MSVC and link it to something compiled
>> with g++.
>> Look up my CodeProject article on member function pointers -- every
>> vendor has their own API, and virtually none of them are documented.
>> On Windows, extern(C++) means extern(DMC++), but for me, the only thing
>> I'd want to link to is MSVC. Much more useful would be, as Brad says, to
>> provide a way of specifying the name mangling. If we could do that, we'd
>> be more compatible with C++ than C++ is to itself.

There's a lot more to compatibility than name mangling.

> This brings up another important point:  If any implementation of extern(C++) is
> tied to a specific C++ compiler anyhow

extern(C) is also tied to a particular C compiler.

> (probably the one made by the same people
> that made the D compiler) then why the heck is it so limited?  The rationale for
> it being so limited was that doing it better would practically require
> implementing a C++ compiler.

More information about the Digitalmars-d mailing list