lkml.org 
[lkml]   [2020]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: GCC bug ? Re: [PATCH v2 10/10] powerpc/32s: Implement Kernel Userspace Access Protection
From
Date


Le 21/01/2020 à 20:55, Segher Boessenkool a écrit :
> On Tue, Jan 21, 2020 at 05:22:32PM +0000, Christophe Leroy wrote:
>> g1() should return 3, not 5.
>
> What makes you say that?
>
> "A return of 0 does not indicate that the
> value is _not_ a constant, but merely that GCC cannot prove it is a
> constant with the specified value of the '-O' option."
>

GCC doc also says:

"if you use it in an inlined function and pass an argument of the
function as the argument to the built-in, GCC never returns 1 when you
call the inline function with a string constant"

Does GCC considers (void*)0 as a string constant ?

Christophe

\
 
 \ /
  Last update: 2020-01-22 07:57    [W:0.108 / U:4.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site