[Issue 4701] New: Should returning a value in a void function be downgraded to a warning?
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Aug 21 02:59:21 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4701
Summary: Should returning a value in a void function be
downgraded to a warning?
Product: D
Version: D1 & D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: ibuclaw at ubuntu.com
--- Comment #0 from Iain Buclaw <ibuclaw at ubuntu.com> 2010-08-21 02:59:18 PDT ---
The code:
void main()
{
return true;
}
Results in the compiler error:
test.d(3): Error: long has no effect in expression (true)
Which makes sense, but doesn't really indicate the reasoning very well.
Shouldn't it be instead downgraded to a warning? ie - based on GCC's message:
test.c:(3): Warning: ignoring return value in function returning void
This currently blocks some old D software from building (that, I know, should
really be updated. :)
Regards
Iain
--
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