]> Savannah Git Hosting - gnulib.git/commit
strtol, strtoll, strtoul, strtoull: Make ISO C 23 compliant.
authorBruno Haible <bruno@clisp.org>
Thu, 16 Mar 2023 15:02:02 +0000 (16:02 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 16 Mar 2023 15:02:02 +0000 (16:02 +0100)
commit4e38f4a0c65d4d19883b404a84169088b84b60d2
treefa1a1f6d165107f06ba249f5fef5edd570574ca2
parent4873f857dd32e7d145e285d72ffcc54fca54df31
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.
14 files changed:
ChangeLog
doc/posix-functions/strtol.texi
doc/posix-functions/strtoll.texi
doc/posix-functions/strtoul.texi
doc/posix-functions/strtoull.texi
lib/strtol.c
m4/strtol.m4
m4/strtoll.m4
m4/strtoul.m4
m4/strtoull.m4
tests/test-strtol.c
tests/test-strtoll.c
tests/test-strtoul.c
tests/test-strtoull.c