]> Savannah Git Hosting - gnulib.git/commitdiff
test-stdint: use _GL_VERIFY rather than "verify" for some tests
authorJim Meyering <meyering@fb.com>
Wed, 12 Oct 2016 19:30:07 +0000 (12:30 -0700)
committerJim Meyering <meyering@fb.com>
Thu, 13 Oct 2016 21:55:12 +0000 (14:55 -0700)
* tests/test-stdint.c (verify_width): Implement with _GL_VERIFY
and an abbreviated diagnostic rather than verify with the full one,
because the full-length strings would evoke warnings from gcc with
-Woverlength-strings.

ChangeLog
tests/test-stdint.c

index 32bddf8119f647a5d72c863266a3ecaad300ba1c..f94feb1982406149750f837911c27351c37e8eb0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2016-10-12  Jim Meyering  <meyering@fb.com>
+
+       test-stdint: use _GL_VERIFY rather than "verify" for some tests
+       * tests/test-stdint.c (verify_width): Implement with _GL_VERIFY
+       and an abbreviated diagnostic rather than verify with the full one,
+       because the full-length strings would evoke warnings from gcc with
+       -Woverlength-strings.
+
 2016-10-13  Paul Eggert  <eggert@cs.ucla.edu>
 
        stdint: port SIZE_MAX to glibc s390
index c0e2f08abfd53d7c2cf89d0275403e7944a32065..6eb1d2edab7a4b7a1ef13f472bb256fdd026e820 100644 (file)
@@ -351,10 +351,19 @@ verify_same_types (INTMAX_C (17), (intmax_t)0 + 0);
 verify (UINTMAX_C (17) == 17);
 verify_same_types (UINTMAX_C (17), (uintmax_t)0 + 0);
 
-/* Macros specified by ISO/IEC TS 18661-1:2014.  */
-
+/* Use _GL_VERIFY (with a fixed-length diagnostic string) rather than verify,
+   because the latter would require forming each stringified expression, and
+   many of these would be so long as to trigger a warning/error like this:
+
+   test-stdint.c:407:1: error: string length '6980' is greater than the \
+     length '4095' ISO C99 compilers are required to support \
+     [-Werror=overlength-strings]
+  */
 #define verify_width(width, min, max) \
-  verify ((max) >> ((width) - 1 - ((min) < 0)) == 1)
+  _GL_VERIFY ((max) >> ((width) - 1 - ((min) < 0)) == 1, \
+              "verify_width check")
+
+/* Macros specified by ISO/IEC TS 18661-1:2014.  */
 
 #ifdef INT8_MAX
 verify_width (INT8_WIDTH, INT8_MIN, INT8_MAX);