[Issue 15217] New: overloaded extern(C) function declarations are allowed
    via Digitalmars-d-bugs 
    digitalmars-d-bugs at puremagic.com
       
    Sat Oct 17 06:39:36 PDT 2015
    
    
  
https://issues.dlang.org/show_bug.cgi?id=15217
          Issue ID: 15217
           Summary: overloaded extern(C) function declarations are allowed
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: k.hara.pg at gmail.com
            Blocks: 14147
Simple test case:
extern (C) void foo(void function() fp);
extern (C) void foo(void function() @nogc fp) @nogc;
This is included in issue 14147, but it's actually used in current druntime
code to ignore attribute differences.
----
extern (C):
private alias void function(int) sigfn_t;
nothrow @nogc
{
    private alias void function(int) sigfn_t2;
}
version (CRuntime_Glibc)
{
    sigfn_t bsd_signal(int sig, sigfn_t func);
  nothrow:
  @nogc:
    sigfn_t2 bsd_signal(int sig, sigfn_t2 func);
}
----
The extern (C) bsd_signal function is overloaded but they refers same link
symbol '_bsd_signal'.
--
    
    
More information about the Digitalmars-d-bugs
mailing list