test-intprops: disable -Wtype-limits diagnostics
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 24 May 2011 23:47:01 +0000 (16:47 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 24 May 2011 23:48:17 +0000 (16:48 -0700)
* tests/test-intprops.c: Use a pragma to ignore -Wtype-limits
diagnostics.  Otherwise, the integer overflow macros generate many
diagnostics.  Reported by Jim Meyering in
<http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00528.html>.

ChangeLog
tests/test-intprops.c

index fee8b5ad31da29184c1174a0680ee101ac7d2f4c..390d4e808d2eaf4c3e9b4f6ad7991509510f8db1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2011-05-24  Paul Eggert  <eggert@cs.ucla.edu>
 
+       test-intprops: disable -Wtype-limits diagnostics
+       * tests/test-intprops.c: Use a pragma to ignore -Wtype-limits
+       diagnostics.  Otherwise, the integer overflow macros generate many
+       diagnostics.  Reported by Jim Meyering in
+       <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00528.html>.
+
        intprops: shorten, to pacify gcc -Woverlength-strings
        * lib/intprops.h (_GL_INT_CONVERT, _GL_INT_NEGATE_CONVERT):
        (_GL_BINARY_OP_OVERFLOW): Say "0 * (x)" rather than "(x) - (x)",
index 8fc582b90fc37e2c47bf9c3644cc9d5b860ba72b..1a34d77bf59704508658758e8d1bb6b605989c0b 100644 (file)
 
 /* Written by Paul Eggert.  */
 
+/* Tell gcc not to warn about the many (X < 0) expressions that
+   the overflow macros expand to.  */
+#if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__
+# pragma GCC diagnostic ignored "-Wtype-limits"
+#endif
+
 #include <config.h>
 
 #include "intprops.h"