[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: count-one-bits: compilation failure with HP-UX cc
From: |
Bruno Haible |
Subject: |
Re: count-one-bits: compilation failure with HP-UX cc |
Date: |
Sun, 13 Apr 2008 22:52:52 +0200 |
User-agent: |
KMail/1.5.4 |
James Youngman wrote:
> It might be worth including a comment explaining the problem in the
> source, so that the somebody else does not accidentally re-introduce
> the same bug.
You're right. Done:
*** lib/count-one-bits.h.orig 2008-04-13 22:51:41.000000000 +0200
--- lib/count-one-bits.h 2008-04-13 22:51:25.000000000 +0200
***************
*** 30,35 ****
--- 30,37 ----
return BUILTIN (x);
#else
#define COUNT_ONE_BITS(BUILTIN, TYPE) \
+ /* This condition is written so as to avoid shifting by more than \
+ 31 bits at once, and also avoids a random HP-UX cc bug. */ \
verify (((TYPE) -1 >> 31 >> 31 >> 2) == 0); /* TYPE has at most 64
bits */ \
int count = count_one_bits_32 (x); \
if (1 < (TYPE) -1 >> 31) /* TYPE has more than 32 bits? */ \