aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/stdio/scanf.3
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2023-09-07 06:14:44 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2023-09-07 06:40:14 +0000
commitbce0bef3c6abab92c7ac8cc23b7cc632a382721e (patch)
tree916fe3a02348b3a7b0ecaf0bbdf5f95e2f55a1f3 /lib/libc/stdio/scanf.3
parent294bd2827e61a78041f6613f4b82235fcc454157 (diff)
libc: Implement N2680.
This adds specific width length modifiers in the form of wN and wfN (where N is 8, 16, 32, or 64) which allow printing intN_t and int_fastN_t without resorting to casts or PRI macros. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D41725
Diffstat (limited to 'lib/libc/stdio/scanf.3')
-rw-r--r--lib/libc/stdio/scanf.330
1 files changed, 29 insertions, 1 deletions
diff --git a/lib/libc/stdio/scanf.3 b/lib/libc/stdio/scanf.3
index 6cefdb133983..b8d2360c5e76 100644
--- a/lib/libc/stdio/scanf.3
+++ b/lib/libc/stdio/scanf.3
@@ -31,7 +31,7 @@
.\"
.\" @(#)scanf.3 8.2 (Berkeley) 12/11/93
.\"
-.Dd August 21, 2023
+.Dd September 5, 2023
.Dt SCANF 3
.Os
.Sh NAME
@@ -217,6 +217,34 @@ and the next pointer is a pointer to a
.Vt ptrdiff_t
(rather than
.Vt int ) .
+.It Cm w Ns Ar N
+.Po
+where
+.Ar N
+is 8, 16, 32, or 64
+.Pc
+Indicates that the conversion will be one of
+.Cm bdioux
+or
+.Cm n
+and the next pointer is a pointer to a
+.Vt intN_t
+(rather than
+.Vt int ) .
+.It Cm wf Ns Ar N
+.Po
+where
+.Ar N
+is 8, 16, 32, or 64
+.Pc
+Indicates that the conversion will be one of
+.Cm bdioux
+or
+.Cm n
+and the next pointer is a pointer to a
+.Vt int_fastN_t
+(rather than
+.Vt int ) .
.It Cm z
Indicates that the conversion will be one of
.Cm bdioux