[Issue 13165] New: Not located "Warning: statement is not reachable" with -profile, If return statement exists in void main()
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sat Jul 19 19:28:11 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=13165
Issue ID: 13165
Summary: Not located "Warning: statement is not reachable" with
-profile, If return statement exists in void main()
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: minor
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: sinkuu at aol.jp
void main()
{
return;
// Warning: statement is not reachable
// (No location reported, but removing `return;` prevents this warning.)
}
Same warning with always true condition:
void main() { if (true) return; }
No warnings:
void main(string[] args) { if (args) return; }
int main() { return 0; }
void myFunc() { return; } // happens only in void main()
--
More information about the Digitalmars-d-bugs
mailing list