Scoped external function declaration

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jan 2 02:52:26 PST 2015


On Fri, 02 Jan 2015 10:40:22 +0000
novice2 via Digitalmars-d-learn <digitalmars-d-learn at puremagic.com>
wrote:

> Thanx Daniel, thanx Ketmar.
> 
> I just thinked that this is some sort of bug.
> May be DMD should not change mangled name of external function...
> Bit i dont know.
with `extern(C)` it didn't. what you probably not realised is that D
has nested functions, so extern which declared inside other function
becomes right this: an extern nested function. that's why D compiler
mangles it's name. there are no nested functions in C, but D is not
C. ;-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20150102/f93205c8/attachment.sig>


More information about the Digitalmars-d-learn mailing list