diff options
| author | Alejandro Colomar <alx@kernel.org> | 2025-03-23 19:47:33 +0100 |
|---|---|---|
| committer | Alejandro Colomar <alx@kernel.org> | 2025-03-23 20:45:45 +0100 |
| commit | 2b2519c7722166dbe4313da6ec048d137ea42ba7 (patch) | |
| tree | 5249e4f9726b33f42f1eb54908088991cbfaae0b | |
| parent | 87cde07f6a6b86f151743108eb0f4584d84befbc (diff) | |
| download | man-pages-2b2519c7722166dbe4313da6ec048d137ea42ba7.tar.gz | |
man/man3/strto[u]l.3: C23 added "0b" and "0B"
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>
| -rw-r--r-- | man/man3/strtol.3 | 16 | ||||
| -rw-r--r-- | man/man3/strtoul.3 | 16 |
2 files changed, 26 insertions, 6 deletions
diff --git a/man/man3/strtol.3 b/man/man3/strtol.3 index 2ae48119b9..7744628cb2 100644 --- a/man/man3/strtol.3 +++ b/man/man3/strtol.3 @@ -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 diff --git a/man/man3/strtoul.3 b/man/man3/strtoul.3 index c6a2bb9be7..7e13dce8cd 100644 --- a/man/man3/strtoul.3 +++ b/man/man3/strtoul.3 @@ -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 () |
