--- Comment #3 from Martin Nowak <> ---
(In reply to Jacob Carlborg from comment #0)
> Note that global C function will not have a mangling, but methods of a
> struct or class declared as `extern (C)` will get mangled as a D method.
> This can be used as a callback function for a C function.

So you're bug report is about

cat > bug.d << CODE
struct S
    extern(C) static void foo(int) {}
    extern(C) static void foo(double) {}
dmd -c bug.d
Error: function cannot be overloaded with another extern(C)
function at /home/dawg/Code/D/bug.d(3)


For top-level functions there is no way to just use C calling convention
without the mangling, so the example from the OP will clearly lead to a
multiple definition problem and undefined behavior dependening on various
linker behaviors.

Introduced here

BTW, please use [Reg <upcoming version>] instead of a non-permanent [Reg
nightly]. For nightlies it's the next major version, so 2.079.0 in your case.


Reply via email to