www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15217] New: overloaded extern(C) function declarations are


          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 puremagic.com
          Reporter: k.hara.pg 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);

    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'.

Oct 17 2015