]> Savannah Git Hosting - gnulib.git/commitdiff
strtol: match 'configure' to 'make check'
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 22 May 2023 01:25:45 +0000 (18:25 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 22 May 2023 01:26:05 +0000 (18:26 -0700)
Inferred from report by Tomasz Kłoczko <https://bugs.gnu.org/63632>.
* m4/strtol.m4 (gl_FUNC_STRTOL):
* m4/strtoll.m4 (gl_FUNC_STRTOLL):
Also test "0b", since the test cases check it.

ChangeLog
m4/strtol.m4
m4/strtoll.m4

index 8b29eed568a06bd136425c1736ad670c8067b227..37eb0a06c6b46992ccea76126752de3208d32995 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2023-05-21  Paul Eggert  <eggert@cs.ucla.edu>
 
+       strtol: match 'configure' to 'make check'
+       Inferred from report by Tomasz Kłoczko <https://bugs.gnu.org/63632>.
+       * m4/strtol.m4 (gl_FUNC_STRTOL):
+       * m4/strtoll.m4 (gl_FUNC_STRTOLL):
+       Also test "0b", since the test cases check it.
+
        git-merge-changelog: port to size_t padding
        * lib/git-merge-changelog (entry_hashcode):
        As a nicety, Prefer SIZE_WIDTH to computing it ourselves.
index 5cdd86adc72525208e8b744423db5fde0b56932c..b5ea56f2294d0ad244d092a2e6dbfed06dd5deb8 100644 (file)
@@ -1,4 +1,4 @@
-# strtol.m4 serial 8
+# strtol.m4 serial 9
 dnl Copyright (C) 2002-2003, 2006, 2009-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -19,10 +19,16 @@ AC_DEFUN([gl_FUNC_STRTOL],
               char *term;
               /* This test fails on Minix and native Windows.  */
               {
-                const char input[] = "0x";
-                (void) strtol (input, &term, 16);
-                if (term != input + 1)
-                  result |= 1;
+                static char const input[2][3] = {"0x", "0b"};
+                static int const base[] = {0, 2, 10};
+                int i, j;
+                for (i = 0; i < 2; i++)
+                  for (j = 0; j < 3; j++)
+                    {
+                      (void) strtol (input[i], &term, base[j]);
+                      if (term != input[i] + 1)
+                        result |= 1;
+                    }
               }
               /* This test fails on pre-C23 platforms.  */
               {
index ec09609cd42591c45dfd258d1bc570470093c925..a0cbc805bc9ae013c1c5b2107635bd33e0ceb51f 100644 (file)
@@ -1,4 +1,4 @@
-# strtoll.m4 serial 10
+# strtoll.m4 serial 11
 dnl Copyright (C) 2002, 2004, 2006, 2008-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -19,10 +19,16 @@ AC_DEFUN([gl_FUNC_STRTOLL],
               char *term;
               /* This test fails on Minix and native Windows.  */
               {
-                const char input[] = "0x";
-                (void) strtoll (input, &term, 16);
-                if (term != input + 1)
-                  result |= 1;
+                static char const input[2][3] = {"0x", "0b"};
+                static int const base[] = {0, 2, 10};
+                int i, j;
+                for (i = 0; i < 2; i++)
+                  for (j = 0; j < 3; j++)
+                    {
+                      (void) strtoll (input[i], &term, base[j]);
+                      if (term != input[i] + 1)
+                        result |= 1;
+                    }
               }
               /* This test fails on pre-C23 platforms.  */
               {