summaryrefslogtreecommitdiff
path: root/usr.bin/printf/printf.1
diff options
context:
space:
mode:
authorkre <kre@NetBSD.org>2018-08-31 17:27:35 +0000
committerkre <kre@NetBSD.org>2018-08-31 17:27:35 +0000
commit48d6da036cf3d7623f98d2d600ff68406285550f (patch)
treeef6945a79ab87c44eb53555251a00abe41cde27a /usr.bin/printf/printf.1
parenta7da9958179b15c603602d12dcd4427bcf8a3b9f (diff)
PR standards/53563
POSIX requires that signed numbers (strings preceded by '+' or '-') be allowed as inputs to all of the integer format conversions, including those which treat the data as unsigned. Hence we do not need a variant function whose only difference from its companion is to reject strings starting with '-' - instead we use the primary function (getintmax()) for everything and remove getuintmax(). Minor update to the man page to indicate that the arg to all of the integer conversions (diouxX) must be an integer constant (with an optional sign) and to make it blatantly clear that %o is octal and %u is unsigned decimal (for some reason those weren't explicitly stated unlike d i x and X). Delete "respectively", it is not needed (and does not really apply). XXX pullup -8
Diffstat (limited to 'usr.bin/printf/printf.1')
-rw-r--r--usr.bin/printf/printf.113
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.bin/printf/printf.1 b/usr.bin/printf/printf.1
index d0ad3aeb66e..588614d3285 100644
--- a/usr.bin/printf/printf.1
+++ b/usr.bin/printf/printf.1
@@ -1,4 +1,4 @@
-.\" $NetBSD: printf.1,v 1.30 2018/07/24 20:58:39 kre Exp $
+.\" $NetBSD: printf.1,v 1.31 2018/08/31 17:27:35 kre Exp $
.\"
.\" Copyright (c) 1989, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -32,7 +32,7 @@
.\"
.\" from: @(#)printf.1 8.1 (Berkeley) 6/6/93
.\"
-.Dd July 25, 2018
+.Dd August 31, 2018
.Dt PRINTF 1
.Os
.Sh NAME
@@ -255,9 +255,12 @@ The format characters and their meanings are:
.Bl -tag -width Fl
.It Cm diouXx
The
-.Ar argument
-is printed as a signed decimal (d or i), unsigned octal, unsigned decimal,
-or unsigned hexadecimal (X or x), respectively.
+.Ar argument ,
+which must represent an integer constant,
+with an optional leading plus or minus sign,
+is printed as a signed decimal (d or i),
+unsigned octal (o), unsigned decimal (u),
+or unsigned hexadecimal (X or x).
.It Cm fF
The
.Ar argument