Re: 2.6-test2: gcc-3.3.1 warning.
From: Richard Henderson
Date: Sat Aug 16 2003 - 20:29:53 EST
On Tue, Jul 29, 2003 at 08:35:07AM -0700, Randy.Dunlap wrote:
> I really hate to get this back to the original problem, but is
> the reported warning a gcc 3.3.x problem? I don't see the assembly
> problem here.
>
> | arch/i386/kernel/reboot.c: In function `machine_restart':
> | arch/i386/kernel/reboot.c:261: warning: use of memory input without
> | lvalue in asm operand 0 is deprecated
static long no_idt[2];
...
__asm__ __volatile__("lidt %0": :"m" (no_idt));
Notice that no_idt is an array. Therefore its identifier decays
into a pointer. Therefore, what this statement is really asking
for is
{
long *tmp = no_idt;
asm volatile ("lidt %0" : : "m" (*&tmp));
}
which is clearly not what was intended.
Fixed by doing
__asm__ __volatile__("lidt %0": :"m" (*no_idt));
r~
-
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/