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

Roland McGrath roland@hack.frob.com
Fri Sep 12 17:52:00 GMT 2014


> 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).



More information about the Libc-alpha mailing list