[Issue 18393] REG(v2.078.1=>master) function re-declarations causes conflict, but should not

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Feb 8 00:26:01 UTC 2018


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

--- Comment #5 from Timothee Cour <timothee.cour2 at gmail.com> ---
probably related to this PR:
https://github.com/dlang/dmd/pull/7577/files#diff-3084a264389e086215b36670ae9f4a3dR392

snippet:

/* Allow the hack that is actually used in druntime,
+                     * to ignore function attributes for extern (C) functions.
+                     * TODO: Must be reconsidered in the future.
+                     *  BUG: https://issues.dlang.org/show_bug.cgi?id=18206
+                     *
+                     *  extern(C):
+                     *  alias sigfn_t  = void function(int);
+                     *  alias sigfn_t2 = void function(int) nothrow @nogc;
+                     *  sigfn_t  bsd_signal(int sig, sigfn_t  func);
+                     *  sigfn_t2 bsd_signal(int sig, sigfn_t2 func) nothrow
@nogc;  // no error
+                     */


why would extern(C) be allowed to redeclare but not extern(C++)?


from looking at druntime it shows:
```
extern(C):
sigfn_t bsd_signal(int sig, sigfn_t func);
sigfn_t2 bsd_signal(int sig, sigfn_t2 func);
```
indeed, `bsd_signal` is being redeclared...

not sure i understand the details of why that’s needed but I don’t understand
why extern(C++) would differ from extern(C)

--


More information about the Digitalmars-d-bugs mailing list