]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
man/man3/strto[u]l.3: C23 added "0b" and "0B"
authorAlejandro Colomar <alx@kernel.org>
Sun, 23 Mar 2025 18:47:33 +0000 (19:47 +0100)
committerAlejandro Colomar <alx@kernel.org>
Sun, 23 Mar 2025 19:45:45 +0000 (20:45 +0100)
Link: <https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=64924422a99690d147a166b4de3103f3bf3eaf6c>
Reported-by: Bruno Haible <bruno@clisp.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
man/man3/strtol.3
man/man3/strtoul.3

index 2ae48119b9ecd24c8e4db813a455ac07917fb964..7744628cb2a7744d74510d90b57de71437e805e6 100644 (file)
@@ -53,8 +53,13 @@ followed by a single optional \[aq]+\[aq] or \[aq]\-\[aq] sign.
 If
 .I base
 is zero or 16, the string may then include a
-"0x" or "0X" prefix, and the number will be read in base 16; otherwise, a
-zero
+"0x" or "0X" prefix, and the number will be read in base 16;
+if
+.I base
+is zero or 2, the string may then include a
+"0b" or "0B" prefix, and the number will be read in base 2;
+otherwise,
+a zero
 .I base
 is taken as 10 (decimal) unless the next character
 is \[aq]0\[aq], in which case it is taken as 8 (octal).
@@ -183,7 +188,7 @@ may be equivalent to
 or to
 .BR strtol ().
 .SH STANDARDS
-C11, POSIX.1-2008.
+C23, POSIX.1-2024.
 .SH HISTORY
 .TP
 .BR strtol ()
@@ -191,6 +196,11 @@ POSIX.1-2001, C89, SVr4, 4.3BSD.
 .TP
 .BR strtoll ()
 POSIX.1-2001, C99.
+.TP
+"0b", "0B"
+C23.
+glibc 2.38.
+(Not in POSIX.)
 .SH CAVEATS
 .SS Range checks
 Since
index c6a2bb9be7c191d5d86c191ffa65c50693daceda..7e13dce8cdfa634c2cf155727c7adc0339fa64f6 100644 (file)
@@ -59,8 +59,13 @@ sign.
 If
 .I base
 is zero or 16, the string may then include a
-"0x" or "0X" prefix, and the number will be read in base 16; otherwise, a
-zero
+"0x" or "0X" prefix, and the number will be read in base 16;
+if
+.I base
+is zero or 2, the string may then include a
+"0b" or "0B" prefix, and the number will be read in base 2;
+otherwise,
+a zero
 .I base
 is taken as 10 (decimal) unless the next character
 is \[aq]0\[aq], in which case it is taken as 8 (octal).
@@ -182,7 +187,7 @@ may be equivalent to
 or to
 .BR strtoul ().
 .SH STANDARDS
-C11, POSIX.1-2008.
+C23, POSIX.1-2024.
 .SH HISTORY
 .TP
 .BR strtoul ()
@@ -190,6 +195,11 @@ POSIX.1-2001, C89, SVr4.
 .TP
 .BR strtoull ()
 POSIX.1-2001, C99.
+.TP
+"0b", "0B"
+C23.
+glibc 2.38.
+(Not in POSIX.)
 .SH CAVEATS
 Since
 .BR strtoul ()