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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 09, 2007 at 05:34:16PM +0100, Franck Bui-Huu wrote:
> Date:	Fri, 9 Feb 2007 17:34:16 +0100
> From:	"Franck Bui-Huu" <fbuihuu@xxxxxxxxx>
> To:	"Atsushi Nemoto" <anemo@xxxxxxxxxxxxx>
> Subject: Re: [PATCH 3/3] signal.c: fix gcc warning on 32 bits kernel
> Cc:	vagabon.xyz@xxxxxxxxx, ralf@xxxxxxxxxxxxxx,
> 	linux-mips@xxxxxxxxxxxxxx
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> On 2/9/07, Atsushi Nemoto <anemo@xxxxxxxxxxxxx> wrote:
> >On Fri,  9 Feb 2007 16:07:38 +0100, Franck Bui-Huu <vagabon.xyz@xxxxxxxxx> 
> >wrote:
> >>       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
> 
> yes I agree but it seems that gcc compiles this line before optimizing 
> out...
> 
> >
> >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.
> 
> I agree too but I haven't found something else.

All gcc versions produce this warning and no, it's not a gcc bug but a
kernel bug.  __get_user expands into:

        case 8: {
                unsigned long long __gu_tmp;
[...]
		new_ka.sa.sa_handler =
			(__typeof__(*((&act->sa_handler)))) __gu_tmp;
	}

Which is quite a funny C problem to solve :-)

  Ralf


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux