I often have to state the case against pre-initialization (in other
words, I
agree with Martin). Here is how I see it.
The compiler is actually the nice guy here, and the warning is with good
intent. As it
often is the case, there are paths through the program where that
variable remains
uninitialized. It is too complicated for the compiler to realise that
the places
where is is used are on dynamic paths where it is initialised.
As sometimes is the case, such a warning may expose a real problem in
the logic.
Now, initialising right at the top destroyes any chance for the compiler
to warn
you. The habit of initialising everything is wrong. It is perfectly
allright to have
an uninitialised variable - you should only initialise if it is true
that the variable
should have that value at that point.
Reading what I just wrote I find it overbearing. Heck, I will state
simply that losing
the services of the compiler is too much to pay for avoiding the few
wrong noises it makes
sometimes.
[kernel list? what kernel list? are you sure this is the kernel list?
doesn't look like one]
-- Eyal Lebedinsky (eyal@eyal.emu.id.au)