[PATCH v2] __builtin_expect cleanup for iconv{,data}/*.c

Carlos O'Donell carlos@redhat.com
Fri Sep 12 18:18:00 GMT 2014


On 09/12/2014 01:52 PM, Roland McGrath wrote:
>> On 09/10/2014 02:07 PM, Roland McGrath wrote:
>>> The preferred style in glibc has always been to eschew implicit Boolean
>>> coercions, except for the return value of strcmp/memcmp and the like (where
>>> the most common idiomatic uses treat the value as a Boolean even though
>>> nonzero values have further meaning).
>>>
>>
>> Wikified.
>>
>> https://sourceware.org/glibc/wiki/Style_and_Conventions#Boolean_Coercions
> 
> I forgot to mention the other exception: if (foo & BIT) or if (!(foo & BIT))
> is fine, no need for if ((foo & BIT) != 0) or if ((foo & BIT) == 0).

Wikified++

c.



More information about the Libc-alpha mailing list