Ben Pfaff wrote: > I do agree that 'hamming_weight' is a precise name for this > function. But it is not a descriptive name: one must know by > rote what a Hamming weight is.
Yes, 'hamming_weight' does not help the understanding unless you are already familiar with it. > Bruno Haible <[EMAIL PROTECTED]> continues: > >> +#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR >= 4) > >> +#define POPCOUNT_CALCULATION(NAME) \ > >> + return __builtin_##NAME (x); > > > > This will not work with CC="gcc -fno-builtin". Better use an autoconf test. > > Actual testing with GCC bears this out: > > [EMAIL PROTECTED]:~/gnulib/gnulib(1)$ cat test.c > #include <stdio.h> > int > main (void) > { > printf ("%d\n", __builtin_popcount (5)); > return 0; > } > [EMAIL PROTECTED]:~/gnulib/gnulib(0)$ gcc -Wall -Wextra -fno-builtin > test.c > [EMAIL PROTECTED]:~/gnulib/gnulib(0)$ ./a.out > 2 You're right. Sorry, my mistake. Bruno