Bug 4482 – Missing warnings when not compiling with -w

Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Linux
Creation time
2010-07-18T00:54:00Z
Last change time
2011-06-15T00:47:19Z
Assigned to
nobody
Creator
issues.dlang

Comments

Comment #0 by issues.dlang — 2010-07-18T00:54:36Z
If I have series of statements such as throw new Exception("it broke"); writeln("unreachable"); and compile with -w, then naturally, this won't compile because the second statement is unreachable. That's good. However, if you do not compile with -w, no warning is printed. Shouldn't all warnings be printed regardless and -w simply choose to treat them as errors? As it is, if you're foolish enough not to compile with -w, you can easily miss stuff that's obviously wrong. I can understand the user choosing not to treat a warning as an error, but I would expect it to still be reported, and it's not.
Comment #1 by yebblies — 2011-06-15T00:47:19Z
This is not how it's defined to work in D. Warnings will only be printed if using the -w or -wi compiler switches.