[Issue 11008] New: Allow -main switch even if user-defined main function exists

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Sep 10 21:18:55 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=11008

           Summary: Allow -main switch even if user-defined main function
                    exists
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: k.hara.pg at gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2013-09-10 21:18:51 PDT ---
Currently, if user-defined main() function exists, specifying -main switch will
fail to compile.

// test.d
void main() {}

$ dmd -main -run test
test.d(1): Error: only one main/WinMain/DllMain allowed, -main switch added
another main()

But I think this is unnecessary restriction. Compiler can stop adding "another
main" when user-defined main() detected.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list