Re: Undefined behaviour with get_cpu_vendor

From: Horst von Brand
Date: Wed Aug 17 2005 - 15:10:28 EST


Andi Kleen <ak@xxxxxxx> wrote:
> On Wed, Aug 17, 2005 at 11:54:23AM +0200, Christian Ehrhardt wrote:
> > Your Patch at (URL wrapped)
> >
> > http://www.kernel.org/git/?p=linux/kernel/git/torvalds/old-2.6-bkcvs.git; \
> > a=commit;h=99c6e60afff8a7bc6121aeb847dab27c556cf0c9
> >
> > introduced an additional Parameter (int early) to get_cpu_vendor.
> > However, the same function is called in arch/i386/kernel/apic.c (via
> > an explicit extern declaration that doesn't have the new early parameter.
>
> Sigh. All people adding externs like this should be ...
>
> But it won't change anything - the only difference with
> the flag being 0 is to read less fields, but since the function
> has been called earlier and the data has not changed
> the output is always the same.

I'm not so sure that "argument not explicitly given" will always turn out
zero... more like "random" memory contents.
--
Dr. Horst H. von Brand User #22616 counter.li.org
Departamento de Informatica Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria +56 32 654239
Casilla 110-V, Valparaiso, Chile Fax: +56 32 797513
-
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/