[Issue 15843] D-type mangling used for extern(C) (extern) function declaration inside function body, on LDC, GDC, and DMD.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jan 17 15:09:45 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=15843

Steven Schveighoffer <schveiguy at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schveiguy at gmail.com

--- Comment #4 from Steven Schveighoffer <schveiguy at gmail.com> ---
extern(C) specifies not only the mangling, but also the calling convention. So
having extern(C) inner functions do serve a purpose. I think the mangling is
really implementation defined, since C doesn't have any notion of inner
functions.

Note that `extern` on its own isn't doing anything here.

If anything, I'd say pragma(mangle) should work in this context, that would at
least give a more straightforward path (really issue 22682).

Note that defining the prototype without `static` indeed suggests it should
have a `this` pointer, but it doesn't work even if you add `static`.

--


More information about the Digitalmars-d-bugs mailing list