This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2] __builtin_expect cleanup for iconv{,data}/*.c
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: Kalle Olavi Niemitalo <kon at iki dot fi>, Florian Weimer <fweimer at redhat dot com>, libc-alpha <libc-alpha at sourceware dot org>
- Date: Fri, 12 Sep 2014 14:17:54 -0400
- Subject: Re: [PATCH v2] __builtin_expect cleanup for iconv{,data}/*.c
- Authentication-results: sourceware.org; auth=none
- References: <540E06B0 dot 50406 at redhat dot com> <540F501B dot 2080808 at redhat dot com> <87ha0g4adb dot fsf at Niukka dot kon dot iki dot fi> <541001AC dot 50107 at redhat dot com> <87bnqn4b25 dot fsf at Niukka dot kon dot iki dot fi> <20140910180713 dot D39B72C39CB at topped-with-meat dot com> <54125038 dot 1040109 at redhat dot com> <20140912175231 dot 301EB2C3981 at topped-with-meat dot com>
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.