diff options
author | jkh <jkh@FreeBSD.org> | 1997-01-14 07:31:39 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1997-01-14 07:31:39 +0000 |
commit | 11432bdb025f9c8140361daf7e707751428e195a (patch) | |
tree | 047545fa4cd95539631f3198361f8cb0159f102a /lib/libc/stdio/printf.3 | |
parent | 808a36ef658c1810327b5d329469bcf5dad24b28 (diff) | |
download | FreeBSD-src-11432bdb025f9c8140361daf7e707751428e195a.zip FreeBSD-src-11432bdb025f9c8140361daf7e707751428e195a.tar.gz |
The following patch to lib/libc/stdio implements positional arguments in
a manner consistent with other implementations. Its done in a way that
adds only a tiny amount of overhead when positional arguments are not used.
I also have a test program to go with this, but don't know where it belongs
in the tree.
Submitted-By: Bill Fenner <fenner@FreeBSD.ORG>
Diffstat (limited to 'lib/libc/stdio/printf.3')
-rw-r--r-- | lib/libc/stdio/printf.3 | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/libc/stdio/printf.3 b/lib/libc/stdio/printf.3 index fcea80f..2ff5238 100644 --- a/lib/libc/stdio/printf.3 +++ b/lib/libc/stdio/printf.3 @@ -176,6 +176,16 @@ After the the following appear in sequence: .Bl -bullet .It +An optional field, consisting of a decimal digit string followed by a +.Cm $ , +specifying the next argument to access . +If this field is not provided, the argument following the last +argument accessed will be used. +Arguments are numbered starting at +.Cm 1 . +If unaccessed arguments in the format string are interspersed with ones that +are accessed the results will be indeterminate. +.It Zero or more of the following flags: .Bl -hyphen .It @@ -394,6 +404,8 @@ A character that specifies the type of conversion to be applied. A field width or precision, or both, may be indicated by an asterisk .Ql * +or an asterisk followed by one or more decimal digits and a +.Ql $ instead of a digit string. In this case, an @@ -402,6 +414,8 @@ argument supplies the field width or precision. A negative field width is treated as a left adjustment flag followed by a positive field width; a negative precision is treated as though it were missing. +If a single format directive mixes positional (nn$) +and non-positional arguments, the results are undefined. .Pp The conversion specifiers and their meanings are: .Bl -tag -width "diouxX" |