[Issue 3975] Misnamed main causes linker errors

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 11 19:56:21 PST 2011


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



--- Comment #3 from Bernard Helyer <blood.of.life at gmail.com> 2011-02-11 19:53:50 PST ---
Agreed, but it's not quite as simple as checking the existence of a 'main'
function when compiling without -c. If object files, libraries, or anything of
the sort are being used -- all those must be searched for a main function. On
Linux, where linking is handled by GCC, this would lead to duplication of code
and work -- all for a fairly minor issue. 

Another option is to merely issue a warning if we don't see one -- this would
lead to spurious warnings, and as DMD has no granularity options when it comes
to warnings, is not really an option.

So I think the only viable option is to handle the simple case, where the only
thing passed to DMD is source files (as we know Phobos doesn't have a main).
Not ideal, but should catch cases where the user is genuinely confused by the
linker output.

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