Re: 2.6.14 assorted warnings

From: Dave Jones
Date: Fri Oct 28 2005 - 02:31:19 EST


On Fri, Oct 28, 2005 at 05:21:19PM +1000, Keith Owens wrote:
> gcc 4.0.1 on i386, 2.6.14 assorted warnings.
>
> arch/i386/kernel/cpu/transmeta.c: In function 'init_transmeta':
> arch/i386/kernel/cpu/transmeta.c:11: warning: 'cpu_freq' may be used uninitialized in this function
>
> fs/bio.c: In function 'bio_alloc_bioset':
> fs/bio.c:167: warning: 'idx' may be used uninitialized in this function

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.

Dave

-
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/