Bug 952 – Strange "Error:" prefix on some warning messages
Status
RESOLVED
Resolution
FIXED
Severity
trivial
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2007-02-11T20:15:00Z
Last change time
2014-02-16T15:26:17Z
Keywords
diagnostic
Assigned to
nobody
Creator
smjg
Comments
Comment #0 by smjg — 2007-02-11T20:15:44Z
Some of the warning messages have this strange wording error (no pun intended) in them. For example:
----------
int main() {
return 1;
return 0;
}
----------
warning - warning_unreachable.d(3): Error: statement is not reachable
----------
Why the label "Error:" here? It isn't an error, it's a warning. Presumably the intention was for it to output
warning - warning_unreachable.d(3): statement is not reachable
We should get rid of the string "Error:" label especially from warning messages. Really, it shouldn't be in any complier messages, perhaps apart from those for which it doesn't make sense to give a filename and line number.
You could debate whether it should be this or
warning_unreachable.d(3): Warning: statement is not reachable
but that's an aside.
Comment #1 by yebblies — 2011-06-08T23:29:29Z
It currently outputs:
testx.d(3): Warning: statement is not reachable
when compiled with -w
Comment #2 by smjg — 2013-02-17T17:29:31Z
This bug is about warning messages _generally_, not just this particular one.
And a new instance has cropped up:
----- switch_fallthrough_b.d -----
void main() {
char c = 'x';
switch(c) {
case 'U', 'u' :
c = 'q';
case 'L', 'l' :
c = 'r';
// code . . .
default:
}
}
----------
C:\Users\Stewart\Documents\Programming\D\Tests>dmd switch_fallthrough_b.d
C:\Users\Stewart\Documents\Programming\D\Tests>dmd -w switch_fallthrough_b.d
switch_fallthrough_b.d(6): Error: switch case fallthrough - use 'goto case;' if intended
switch_fallthrough_b.d(9): Error: switch case fallthrough - use 'goto default;' if intended
----------
Comment #3 by andrej.mitrovich — 2013-02-17T17:33:13Z
(In reply to comment #2)
> And a new instance has cropped up:
This will be resolved with pull for Issue 6552.
Comment #4 by clugdbug — 2013-08-21T07:06:51Z
> This bug is about warning messages _generally_, not just this particular one.
That fix applied to all warning messages. It was nothing to do with that particular one. The other instance in comment 2 has been fixed in bug 6552.
Please reopen (or create a new bug) if you find any still-failing failing test cases.