Bug 17172 – redundant `statement is not reachable`: should only show 1 per code block

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Mac OS X
Creation time
2017-02-10T06:28:44Z
Last change time
2024-12-13T18:51:35Z
Assigned to
No Owner
Creator
Timothee Cour
Moved to GitHub: dmd#19234 →

Comments

Comment #0 by timothee.cour2 — 2017-02-10T06:28:44Z
D20170209T222632 dmd -c -o- -w test.d: ``` void test(){ version(linux) return; int a=1; int b=1; } ``` test.d(1): Warning: statement is not reachable test.d(2): Warning: statement is not reachable Expected: test.d(1): Warning: statement is not reachable The 2nd warning is in the same code block so is redundant. This is annoying: * when debugging and doing an early return as shown, it can show tons of warnings (masking more useful ones) * the workaround is to use: version(none){ // unused code } but it has issues: - increases indentation - the code is no longer checked for being compilable, and after a while becomes out of sync.
Comment #1 by robert.schadek — 2024-12-13T18:51:35Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19234 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB