Messages in this thread | | | Date | Sat, 16 Aug 2003 18:25:51 -0700 | From | Richard Henderson <> | Subject | Re: 2.6-test2: gcc-3.3.1 warning. |
| |
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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |