Re: [git patches] two warning fixes

From
Stephen Hemminger <hidden>
Date
2007-07-19 18:20:52
Reply to
Linus Torvalds, 2007-07-19
On Thu, 19 Jul 2007 11:04:29 -0700 (PDT)
Linus Torvalds [off-list ref] wrote:

On Thu, 19 Jul 2007, Krzysztof Halasa wrote:
quoted
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
Can we ever get the gcc developers to fix all the bogus warnings
about variables that "might not be set"?

-------------------------------------------------------------------------
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/
Thread (4 messages) 4 messages, 4 authors, last reply 2007-07-23
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help