[Issue 224] New: Incorrect warning "no return at end of function"
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Jun 25 03:02:31 PDT 2006
http://d.puremagic.com/issues/show_bug.cgi?id=224
Summary: Incorrect warning "no return at end of function"
Product: D
Version: 0.161
Platform: PC
OS/Version: Windows
Status: NEW
Keywords: diagnostic, rejects-valid
Severity: minor
Priority: P3
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: deewiant at gmail.com
int main() {
// or for (;;), or while (true), or do...while(true);
if (true)
return 0;
}
Such code generates (when compiled with -w) the warning "function module.main
no return at end of function".
But, of course, if allowed to compile, the function would return 0.
--
More information about the Digitalmars-d-bugs
mailing list