www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10591] New: Error: only one main allowed doesn't show location of conflicting main symbols

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10591

           Summary: Error: only one main allowed doesn't show location of
                    conflicting main symbols
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: thelastmammoth gmail.com



---a.d
void main(){}
---

---b.d
void main(){}
---

---main.d
import a,b;
---

rdmd main.d
(or dmd main.d a.d b.d)

=>b.d(1): Error: only one main allowed
the error message should show:
b.d(1): Error: only one main allowed (previously defined in a.d(1))

In more complex cases (with auto generated code or mixins etc), it can be hard
to trace down location of such main symbols, so compiler should show that.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 09 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10591


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich gmail.com



20:24:22 PDT ---
I guess I should have been more persistent about error messages:
https://github.com/D-Programming-Language/dmd/pull/1753#discussion_r3403264

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 09 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10591




you wrote there:

 But maybe it doesn't matter all that much, the user can do a global search to
find the offending main function.
That can be hard in practice (in my cases I auto-generate my main functions to add instrumentation code; or main could be in object file where we don't have source code etc). And user shouldn't have to do such global search when compiler knows this information. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 10 2013