]> Savannah Git Hosting - gnulib.git/commitdiff
xstrtoll-tests: use %lld for long long
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 17 Jan 2022 06:31:02 +0000 (22:31 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 17 Jan 2022 06:47:07 +0000 (22:47 -0800)
* tests/test-xstrtoll.c, tests/test-xstrtoull.c (__spec):
Do not assume long long is 64 bits, or that exact-width
64-bit types exist.  Although these assumptions are true
on current Gnulib platforms they are not true in general.
Also, GCC warns if PRId64 is "ld" but intmax_t is long long
even when long and long long are both 64 bits.

ChangeLog
tests/test-xstrtoll.c
tests/test-xstrtoull.c

index c941ea151b08525ed75bec7b8e2595182417f1e5..a1896fa7d3deb89d92e100bf02de4ec80ee219dd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2022-01-16  Paul Eggert  <eggert@cs.ucla.edu>
+
+       xstrtoll-tests: use %lld for long long
+       * tests/test-xstrtoll.c, tests/test-xstrtoull.c (__spec):
+       Do not assume long long is 64 bits, or that exact-width
+       64-bit types exist.  Although these assumptions are true
+       on current Gnulib platforms they are not true in general.
+       Also, GCC warns if PRId64 is "ld" but intmax_t is long long
+       even when long and long long are both 64 bits.
+
 2022-01-15  Bruno Haible  <bruno@clisp.org>
 
        Don't pass unknown warning option to clang.
index 03dd232aeebdb4574eeec185747f9f3c46fdfc65..47a552ebff8ab5e3aee53f2663b2a57470270794 100644 (file)
@@ -1,4 +1,4 @@
 #define __xstrtol xstrtoll
 #define __strtol_t long long int
-#define __spec PRId64
+#define __spec "lld"
 #include "test-xstrtol.c"
index cb3a91cf0b2036d42f3c79e7af2e705b4fb3dcdc..cf6c853265c2fbd48a24af41545f453d699dfa9e 100644 (file)
@@ -1,4 +1,4 @@
 #define __xstrtol xstrtoull
 #define __strtol_t unsigned long long int
-#define __spec PRIu64
+#define __spec "llu"
 #include "test-xstrtol.c"