Thread (4 messages) read the whole thread 4 messages, 4 authors, 2007-07-23

Re: [git patches] two warning fixes

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2007-07-19 18:05:43
Also in: lkml


On Thu, 19 Jul 2007, Krzysztof Halasa wrote:
Jeff Garzik [off-list ref] writes:
quoted
My overall goal is killing useless warnings
that continually obscure real ones.
Precisely, the goal should be to make must_check (and similar things)
warn only in real cases.
.. the problem with that mentality is that it's not how people work.

People shut up warnings by adding code.

Adding code tends to add bugs.

People don't generally think "maybe that warning was bogus".

More people *should* generally ask themselves: "was the warning worth it?" 
and then, if the answer is "no", they shouldn't add code, they should 
remove the thing that causes the warning in the first place.

For example, for compiler options, the correct thign is often to just say 
"that option was broken", and not use "-fsign-warning", for example. We've 
literally have had bugs *added* because people "fixed" a sign warning. 
More than once, in fact.

Every time you see a warning, you should ask yourself: is the warning 
interesting, correct and valid? And if it isn't all three, then the 
problem is whatever *causes* the warning, not the code itself.

			Linus

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help