www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18125] New: crt_constructor name conflict

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 puremagic.com
          Reporter: changlon 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

--
Dec 24 2017