This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: checking changes for warning regressions
On Wed, Oct 10, 2012 at 4:26 PM, Roland McGrath <roland@hack.frob.com> wrote:
>> If it is true, why can't we use uint64_t for bswap_64?
>
> We can if we think it's OK for all the headers using <bits/byteswap.h>
> to include <stdint.h> and put all those symbols into the name space.
> That may well be fine, but it needs careful consideration.
>
> The conservative change is to conditionalize the use of long vs long long
> in bits/byteswap.h--that just fixes the regression, without changing the
> API of any public header.
Glibc 2.16 has
# if __GNUC_PREREQ (4, 2)
static __inline unsigned long long int
__bswap_64 (unsigned long long int __bsx)
{
return __builtin_bswap64 (__bsx);
}
It works for x32, i686 and x86-64. We can use long if
__WORDSIZE == 64.
--
H.J.