Wish: Variable Not Used Warning
Nick Sabalausky
a at a.a
Wed Jul 9 12:06:26 PDT 2008
"Walter Bright" <newshound1 at digitalmars.com> wrote in message
news:g530j8$18th$1 at digitalmars.com...
> The reason for treating warnings as errors when warnings are enabled is so
> that, for a long build, they don't scroll up and off your screen and go
> unnoticed.
Pardon me for saying so, but that doesn't sound like a very convincing
reason to turn every warning (which, by it's very nature, is something that
might not be a bug) into something that splits the language into what are
effectively different languages.
In all the time I've spent using Microsoft compilers, I've found the "x
number of errors, y number of warnings" display at the end of every compile
to be perfectly sufficient for the problem you point out. If a build
involves many different calls to a compiler, then whatever rebuild-like tool
is being used could be made to screen-scrape and total up the warnings and
errors. Or the compiler could stick the error/warning counts along in an
output file that gets read and accumulated by the rebuild/make tool. Or a
copy of all the output could just be piped into a "grep for the
error/warning counts" tool. This way, DMD's warnings could be lint-like
warnings instead of the language-splitting "optional errors" (which I can
understand your reluctance to create more of) that they are now. A "treat
warnings as errors" flag could be retained for any large builds that involve
multiple compiler invokations but for some reason still don't do any form of
proper cumulative "x warnings / x errors".
More information about the Digitalmars-d
mailing list