-wi on default?

Jonathan M Davis jmdavisProg at gmx.com
Mon May 7 19:44:53 PDT 2012


On Tuesday, May 08, 2012 04:21:06 bearophile wrote:
> Jonathan M Davis:
> > A good programmer will never leave _any_ warnings in committed
> > code.
> 
> Sometimes warnings are wrong, the compiler is not perfect.
> If the compiler is certain there is a mistake in the code, then
> generating an error is better. Bugs are probabilistic.
> Good lints don't have just "errors", they report issues
> classified in four or five levels of increasingly probability of
> actual problem being present (naming them something like "Info",
> "Note", "Warning", "Probable Error", and "Error").

If it's not something that _must_ be fixed, the compiler should _not_ complain 
about it precisely because you should _never_ leave any warnings in committed 
code. Leaving warnings in committed code (even if invalid) leads to valid 
warnings being missed and/or ignored, which leads to bugs being uncaught. If a 
compiler restricts itself to stuff which is _definitively_ wrong, then that 
isn't a problem. A compiler is _not_ a lint tool and shouldn't be treated as 
one.

> > But certainly the normal thing to do would be to make -wi the
> > default. It'll never happen, but it would be how most compilers
> > work.
> 
> Thank you Jonathan for the very nice way you kill this idea ;-) I
> have some faith in future improvements still.

It'll never happen because you'll never convince Walter of it. As Nick points 
out, it was a miracle to get him to add -wi in the first place. Feel free to 
try, but I'd be _very_ surprised if you managed it.

- Jonathan M Davis


More information about the Digitalmars-d mailing list