Work around a HP cc compiler bug.
authorBruno Haible <bruno@clisp.org>
Sun, 13 Apr 2008 17:25:13 +0000 (19:25 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 13 Apr 2008 17:25:13 +0000 (19:25 +0200)
ChangeLog
lib/count-one-bits.h

index 3ac00fa19d3a366593befe804a72a24843ef2e2e..1b57b0f76bbc25f6e151ee767ce5bec29bea813b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-04-13  Bruno Haible  <bruno@clisp.org>
+
+       * lib/count-one-bits.h (COUNT_ONE_BITS): Rewrite verification
+       expression, so as to avoid HP-UX 11 cc compiler bug.
+
 2008-04-13  Bruno Haible  <bruno@clisp.org>
 
        * m4/regex.m4 (gl_PREREQ_REGEX): Also check for <libintl.h>.
index b1087c3ea262ae089a24880f7bdee2296fa670a8..ae8a5a89bf30bb7a9b00868739d710864928d3ce 100644 (file)
@@ -1,5 +1,5 @@
 /* count-one-bits.h -- counts the number of 1-bits in a word.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007-2008 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -30,7 +30,7 @@
         return BUILTIN (x);
 #else
 #define COUNT_ONE_BITS(BUILTIN, TYPE)                                       \
-        verify ((TYPE) -1 >> 31 >> 31 <= 3); /* TYPE has at most 64 bits */ \
+        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? */          \
           count += count_one_bits_32 (x >> 31 >> 1);                        \