]> Savannah Git Hosting - gnulib.git/commitdiff
tests: port better to XLC 12.01
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 4 Nov 2020 22:51:38 +0000 (14:51 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 4 Nov 2020 22:52:22 +0000 (14:52 -0800)
* tests/test-argmatch.c (CHECK): Do not use -1 as a subscript,
even in code that is not executed, as IBM XLC 12.01 complains "The
subscript -1 is less than zero."
* tests/test-stdint.c (verify_width): Pass an (unused) 3rd
argument to _GL_VERIFY, as ISO C requires.  Otherwise, IBM XLC
12.01 complains "The invocation of macro _GL_VERIFY contains fewer
arguments than are required by the macro definition."

ChangeLog
tests/test-argmatch.c
tests/test-stdint.c

index dcd5baa2a3eaded04f674b009e3e52b111e248ff..fc36c1daea8e1d64e33c3f8c1fe59d19bce7f534 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2020-11-04  Paul Eggert  <eggert@cs.ucla.edu>
+
+       tests: port better to XLC 12.01
+       * tests/test-argmatch.c (CHECK): Do not use -1 as a subscript,
+       even in code that is not executed, as IBM XLC 12.01 complains "The
+       subscript -1 is less than zero."
+       * tests/test-stdint.c (verify_width): Pass an (unused) 3rd
+       argument to _GL_VERIFY, as ISO C requires.  Otherwise, IBM XLC
+       12.01 complains "The invocation of macro _GL_VERIFY contains fewer
+       arguments than are required by the macro definition."
+
 2020-11-03  Bruno Haible  <bruno@clisp.org>
 
        aligned-malloc: Use fixes from the new modules.
index 89a62efe929b4985acd7fb6b9cc1cd8cc42e617e..48ba9d360cf8f70b0a4fb111f2151dd85908167b 100644 (file)
@@ -109,7 +109,8 @@ main (int argc, char *argv[])
     ASSERT (argmatch_backup_choice (Input) == Output);                  \
     if (0 <= Output)                                                    \
       {                                                                 \
-        enum backup_type val = argmatch_backup_args[Output].val;        \
+        enum backup_type val                                            \
+          = argmatch_backup_args[Output < 0 ? 0 : Output].val;          \
         ASSERT (*argmatch_backup_value ("test", Input) == val);         \
         ASSERT (*argmatch_backup_value ("test",                         \
                                         argmatch_backup_argument (&val)) \
index 5e4f30cde19de6b1c34fb63a1c6103383d58efb8..39daf46bf04add54ebfa2506c3ddb4f467f73d4b 100644 (file)
@@ -363,7 +363,7 @@ verify_same_types (UINTMAX_C (17), (uintmax_t)0 + 0);
   */
 #define verify_width(width, min, max) \
   _GL_VERIFY ((max) >> ((width) - 1 - ((min) < 0)) == 1, \
-              "verify_width check")
+              "verify_width check", -)
 
 /* Macros specified by ISO/IEC TS 18661-1:2014.  */