linux-mips
[Top] [All Lists]

Re: [PATCH 3/3] signal.c: fix gcc warning on 32 bits kernel

To: vagabon.xyz@gmail.com
Subject: Re: [PATCH 3/3] signal.c: fix gcc warning on 32 bits kernel
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Sat, 10 Feb 2007 01:18:35 +0900 (JST)
Cc: ralf@linux-mips.org, linux-mips@linux-mips.org, fbuihuu@gmail.com
In-reply-to: <11710336591652-git-send-email-fbuihuu@gmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1171033658561-git-send-email-fbuihuu@gmail.com> <11710336591652-git-send-email-fbuihuu@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
On Fri,  9 Feb 2007 16:07:38 +0100, Franck Bui-Huu <vagabon.xyz@gmail.com> 
wrote:
>   CC      arch/mips/kernel/signal.o
> arch/mips/kernel/signal.c: In function `sys_sigaction':
> arch/mips/kernel/signal.c:266: warning: cast to pointer from integer of 
> different size
> 
> This warning is due to the following line:
> 
>       __get_user(new_ka.sa.sa_handler, &act->sa_handler);

This usage of __get_user() should be absolutely legal.

>       new_ka.sa.sa_handler = (__sighandler_t) __gu_tmp;
> 
> Here we try to cast an 'unsigned long long' into a 32 bits pointer and
> that's the reason of the warning.

This line is never executed on 32bit kernel and gcc optimize out.  On
64-bit kernel, this line is executed without any problem without
warning.

I think this is a problem of __get_user() implementation or gcc
itself.  Though I can not find better solution yet, hacking the caller
to avoid the warning would not be right things to to.

---
Atsushi Nemoto

<Prev in Thread] Current Thread [Next in Thread>