From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10425 invoked by alias); 12 Sep 2014 17:52:35 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 10408 invoked by uid 89); 12 Sep 2014 17:52:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=no version=3.3.2 X-HELO: topped-with-meat.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: Roland McGrath To: "Carlos O'Donell" Cc: Kalle Olavi Niemitalo , Florian Weimer , libc-alpha Subject: Re: [PATCH v2] __builtin_expect cleanup for iconv{,data}/*.c In-Reply-To: Carlos O'Donell's message of Thursday, 11 September 2014 21:45:28 -0400 <54125038.1040109@redhat.com> References: <540E06B0.50406@redhat.com> <540F501B.2080808@redhat.com> <87ha0g4adb.fsf@Niukka.kon.iki.fi> <541001AC.50107@redhat.com> <87bnqn4b25.fsf@Niukka.kon.iki.fi> <20140910180713.D39B72C39CB@topped-with-meat.com> <54125038.1040109@redhat.com> Message-Id: <20140912175231.301EB2C3981@topped-with-meat.com> Date: Fri, 12 Sep 2014 17:52:00 -0000 X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=SvUDtp+0 c=1 sm=1 tr=0 a=WkljmVdYkabdwxfqvArNOQ==:117 a=14OXPxybAAAA:8 a=huui3MpQL3UA:10 a=BDn8O6tT3sYA:10 a=Z6MIti7PxpgA:10 a=kj9zAlcOel0A:10 a=hOe2yjtxAAAA:8 a=CCpqsmhAAAAA:8 a=xKkibcxmk47OGAx8YtQA:9 a=CjuIK1q_8ugA:10 a=66zSKFQpzMcA:10 X-SW-Source: 2014-09/txt/msg00290.txt.bz2 > 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).