From: Paul Eggert Date: Wed, 4 Nov 2020 22:51:38 +0000 (-0800) Subject: tests: port better to XLC 12.01 X-Git-Tag: v1.0~3527 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=5fd2ae0fa3ecc9186d228aca81cbbc768be85685;p=gnulib.git 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." --- diff --git a/ChangeLog b/ChangeLog index dcd5baa2a3..fc36c1daea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2020-11-04 Paul Eggert + + 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 aligned-malloc: Use fixes from the new modules. diff --git a/tests/test-argmatch.c b/tests/test-argmatch.c index 89a62efe92..48ba9d360c 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 5e4f30cde1..39daf46bf0 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. */