lkml.org 
[lkml]   [2003]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 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/

\
 
 \ /
  Last update: 2005-03-22 13:47    [W:0.036 / U:1.552 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site