bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] tests: port better to XLC 12.01


From: Paul Eggert
Subject: [PATCH] tests: port better to XLC 12.01
Date: Wed, 4 Nov 2020 14:52:42 -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             | 11 +++++++++++
 tests/test-argmatch.c |  3 ++-
 tests/test-stdint.c   |  2 +-
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index dcd5baa2a..fc36c1dae 100644
--- 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.
diff --git a/tests/test-argmatch.c b/tests/test-argmatch.c
index 89a62efe9..48ba9d360 100644
--- a/tests/test-argmatch.c
+++ b/tests/test-argmatch.c
@@ -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)) \
diff --git a/tests/test-stdint.c b/tests/test-stdint.c
index 5e4f30cde..39daf46bf 100644
--- a/tests/test-stdint.c
+++ b/tests/test-stdint.c
@@ -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.  */
 
-- 
2.25.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]