Re: 2.6.14 assorted warnings

From: Richard Knutsson
Date: Fri Oct 28 2005 - 03:05:42 EST


Dave Jones wrote:

gcc is dumb, it doesn't realise that the variable will be filled by another
function if its passed thus..

unsigned long foo
bar(&foo)
if (foo==1)
...

With bar() filling in content of foo.
I believe there's at least once instance of this in gcc bugzilla.


Can we blame the compiler not knowing if the function bar will use the value of foo or initialize it?
For these cases, would it not be better to set them a value (for example 0 or maybe UNINIT_DEFAULT)?
After all, the most common warning (as far as i can see) is about uninitialized variables.

Richard

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/