diff options
author | Bruno Haible <bruno@clisp.org> | 2023-03-16 16:02:02 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2023-03-16 16:02:02 +0100 |
commit | 4e38f4a0c65d4d19883b404a84169088b84b60d2 (patch) | |
tree | fa1a1f6d165107f06ba249f5fef5edd570574ca2 /doc | |
parent | 4873f857dd32e7d145e285d72ffcc54fca54df31 (diff) | |
download | gnulib-4e38f4a0c65d4d19883b404a84169088b84b60d2.tar.gz |
strtol, strtoll, strtoul, strtoull: Make ISO C 23 compliant.
* lib/strtol.c (INTERNAL (strtol)): Treat 'b' and base 2 like 'x' and
base 16. Based on glibc commit 64924422a99690d147a166b4de3103f3bf3eaf6c
by Joseph Myers.
* m4/strtol.m4 (gl_FUNC_STRTOL): Test also whether parsing binary
integers works. Update cross-compilation guesses.
* m4/strtoll.m4 (gl_FUNC_STRTOLL): Likewise.
* m4/strtoul.m4 (gl_FUNC_STRTOUL): Likewise.
* m4/strtoull.m4 (gl_FUNC_STRTOULL): Likewise.
* tests/test-strtol.c (main): Add tests of parsing binary integers.
* tests/test-strtoll.c (main): Likewise.
* tests/test-strtoul.c (main): Likewise.
* tests/test-strtoull.c (main): Likewise.
* doc/posix-functions/strtol.texi: Mention the problem with parsing
binary integers.
* doc/posix-functions/strtoll.texi: Likewise.
* doc/posix-functions/strtoul.texi: Likewise.
* doc/posix-functions/strtoull.texi: Likewise.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/posix-functions/strtol.texi | 3 | ||||
-rw-r--r-- | doc/posix-functions/strtoll.texi | 3 | ||||
-rw-r--r-- | doc/posix-functions/strtoul.texi | 3 | ||||
-rw-r--r-- | doc/posix-functions/strtoull.texi | 3 |
4 files changed, 12 insertions, 0 deletions
diff --git a/doc/posix-functions/strtol.texi b/doc/posix-functions/strtol.texi index 5ebcb284d4..061deea1b3 100644 --- a/doc/posix-functions/strtol.texi +++ b/doc/posix-functions/strtol.texi @@ -14,6 +14,9 @@ This function is missing on some old platforms. This function does not parse the leading @samp{0} when the input string is @code{"0x"} and the base is 16 or 0 on some platforms: Minix 3.3, mingw, MSVC 14. +@item +This function does not parse binary integers (with a @samp{0b} or @samp{0B} +prefix) when the base is 2 or 0 on many platforms. @end itemize Portability problems not fixed by Gnulib: diff --git a/doc/posix-functions/strtoll.texi b/doc/posix-functions/strtoll.texi index b507fc33c6..42f73d3449 100644 --- a/doc/posix-functions/strtoll.texi +++ b/doc/posix-functions/strtoll.texi @@ -15,6 +15,9 @@ HP-UX 11.11, MSVC 9. This function does not parse the leading @samp{0} when the input string is @code{"0x"} and the base is 16 or 0 on some platforms: Minix 3.3, mingw, MSVC 14. +@item +This function does not parse binary integers (with a @samp{0b} or @samp{0B} +prefix) when the base is 2 or 0 on many platforms. @end itemize Portability problems not fixed by Gnulib: diff --git a/doc/posix-functions/strtoul.texi b/doc/posix-functions/strtoul.texi index 3b1fa7fb5e..c3a97ee39a 100644 --- a/doc/posix-functions/strtoul.texi +++ b/doc/posix-functions/strtoul.texi @@ -14,6 +14,9 @@ This function is missing on some old platforms. This function does not parse the leading @samp{0} when the input string is @code{"0x"} and the base is 16 or 0 on some platforms: Minix 3.3, mingw, MSVC 14. +@item +This function does not parse binary integers (with a @samp{0b} or @samp{0B} +prefix) when the base is 2 or 0 on many platforms. @end itemize Portability problems not fixed by Gnulib: diff --git a/doc/posix-functions/strtoull.texi b/doc/posix-functions/strtoull.texi index 68ede343e1..ba976a77e6 100644 --- a/doc/posix-functions/strtoull.texi +++ b/doc/posix-functions/strtoull.texi @@ -15,6 +15,9 @@ HP-UX 11.11, MSVC 9. This function does not parse the leading @samp{0} when the input string is @code{"0x"} and the base is 16 or 0 on some platforms: Minix 3.3, mingw, MSVC 14. +@item +This function does not parse binary integers (with a @samp{0b} or @samp{0B} +prefix) when the base is 2 or 0 on many platforms. @end itemize Portability problems not fixed by Gnulib: |