Skip to contentSkip to conversation

printf.3: Add overall structure of format string

PATCH In review Alejandro Colomar 2 participants 2 messages Mar 19, 2021 – Apr 4, 2021 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 printf.3: Add overall structure of format string

From: Utkarsh Singh <[email protected]>

Can we add a small syntax structure for format string in printf(3) manual. I personally find if easier to remember and scan. This has been taken from OpenBSD printf(3) manual.

---
 man3/printf.3 | 8 ++++++++
 1 file changed, 8 insertions(+)
man3/printf.3 +8 -0
index fa6564426..7c993074c 100644
@@ -193,6 +193,14 @@ an optional
 and an optional
 .IR "length modifier" .
 .PP
+Overall syntax of format string is:
+.PP
+.in +4n
+.nf
+%[$][flags][width][.precision][length modifier]conversion
+.fi
+.in
+.PP
 The arguments must correspond properly (after type promotion) with the
 conversion specifier.
 By default, the arguments are used in the order
Signature · 1 line
2.30.1
#1 lore raw

Hi Alex,

Quoted 5 lines · Alejandro Colomar

From: Utkarsh Singh <[email protected]>

Can we add a small syntax structure for format string in printf(3) manual. I personally find if easier to remember and scan. This has been taken from OpenBSD printf(3) manual.

Patch applied.

Thanks,

Michael

Quoted 27 lines
---
 man3/printf.3 | 8 ++++++++
 1 file changed, 8 insertions(+)
man3/printf.3 +8 -0
index fa6564426..7c993074c 100644
@@ -193,6 +193,14 @@ an optional
 and an optional
 .IR "length modifier" .
 .PP
+Overall syntax of format string is:
+.PP
+.in +4n
+.nf
+%[$][flags][width][.precision][length modifier]conversion
+.fi
+.in
+.PP
 The arguments must correspond properly (after type promotion) with the
 conversion specifier.
 By default, the arguments are used in the order
Signature · 3 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/