[Issue 18125] New: crt_constructor name conflict

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Dec 25 06:27:13 UTC 2017


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

          Issue ID: 18125
           Summary: crt_constructor name conflict
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: critical
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: changlon at gmail.com

============== file a.d ============
module a;
extern(C) void  printf(const char*, ...)  @nogc pure nothrow @trusted ;
pragma(crt_constructor) extern(C) void initProcess(){
        printf("call a.m\n");
}
extern(C) int main(){
        printf("main\n");
        return 0;
}
================file b.d ===================
module b;
extern(C) void  printf(const char*, ...)  @nogc pure nothrow @trusted ;
pragma(crt_constructor) extern(C) void initProcess(){
        printf("call b.m\n");
}
==================================

dmd a.d b.d -betterC
./a
call a.m
main



It should output 
./a
call a.m
call b.m
main

--


More information about the Digitalmars-d-bugs mailing list