Re: [PATCH] Input: bcm5974.c initialize raw_w, raw_x and raw_y before it get used
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2009-09-14 04:37:16
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2009-09-14 04:37:16
On Sun, Sep 13, 2009 at 01:39:21PM +0200, Henrik Rydberg wrote:
Jaswinder Singh Rajput wrote:quoted
On Sun, 2009-09-13 at 01:24 +0200, Henrik Rydberg wrote:quoted
Jaswinder Singh Rajput wrote:quoted
raw_w, raw_x and raw_y is used uninitialized for !raw_nThanks for the heads up, but actually not, since !raw_n also implies !(ptest > PRESSURE_LOW).Then can we move 'if (ptest > PRESSURE_LOW && origin)' stuff to 'if (raw_n)'. If not then my patch is correct.Yes, that's it, thanks. So this patch ought to solve the warning cleanly:
Yes, I like this one much better, applied.
quoted
quoted
I wonder how many cpu cycles in the world are spent making compilers happy.It is not compiler mistake it is programming/logic mistakes. We should be thankful to compiler to pointing mistakes made by us.
Except in cases when the compiler is wrong...
The uninitialized-variable warnings have certainly proved their value many times over. I was merely reflecting over the fact that the enclosing space of all such errors could be made smaller by deduction at compile time.
-- Dmitry