freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] Undefined behavior


From: Alexei Podtelezhnikov
Subject: Re: [ft-devel] Undefined behavior
Date: Mon, 11 Aug 2014 14:13:25 -0400

On Mon, Aug 11, 2014 at 11:55 AM, Behdad Esfahbod <address@hidden> wrote:
> On 14-08-11 10:15 AM, Alexei Podtelezhnikov wrote:> On Fri, Aug 8, 2014 at
> 4:56 PM, Behdad Esfahbod <address@hidden> wrote:
>>> commit 177982e933ed6f2ab96163e14f4267f8abe89efd
>>
>> Seriously though, my commit does not change much, both FT_MSB and
>> ft_highpow2 used to return nonsense on zero input even before this
>> commit. I think I am going to apply some patches to protect against
>> reaching this code with zero argument, but I am not willing to change
>> FT_MSB itself.
>
> Non-sense is not the same as undefined.  FT_MSB used to return 0 for 0.  Now
> it's undefined.  See below.

Ok. I still do not think that we should fix the macro, because there
is no good value to return. Returning zero for zero is bad too. One
should not call MSB or the builtins with zero argument, just like one
should not divide by zero. So I'll try to apply fix the callers.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]