Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/usr.bin/printf Pull up following revision(s) (requested b...



details:   https://anonhg.NetBSD.org/src/rev/fe271f08e489
branches:  netbsd-8
changeset: 435231:fe271f08e489
user:      martin <martin%NetBSD.org@localhost>
date:      Sat Sep 01 06:27:12 2018 +0000

description:
Pull up following revision(s) (requested by kre in ticket #1002):

        usr.bin/printf/printf.1: revision 1.31 (via patch)
        usr.bin/printf/printf.c: revision 1.43 (via patch)

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:

 usr.bin/printf/printf.1 |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (34 lines):

diff -r 41bd6886a105 -r fe271f08e489 usr.bin/printf/printf.1
--- a/usr.bin/printf/printf.1   Sat Sep 01 06:19:12 2018 +0000
+++ b/usr.bin/printf/printf.1   Sat Sep 01 06:27:12 2018 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: printf.1,v 1.25 2014/04/13 01:45:34 snj Exp $
+.\"    $NetBSD: printf.1,v 1.25.16.1 2018/09/01 06:27:12 martin 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 May 6, 2008
+.Dd August 31, 2018
 .Dt PRINTF 1
 .Os
 .Sh NAME
@@ -257,9 +257,12 @@
 .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 f
 The
 .Ar argument



Home | Main Index | Thread Index | Old Index