Skip to contentSkip to conversation

printf.3: fix prototype indentation

PATCH In review Mike Frysinger 2 participants 2 messages Mar 5, 2022 – Mar 6, 2022 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: fix prototype indentation

---
 man3/printf.3 | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
man3/printf.3 +5 -5
index 4fa1f11f3c25..e39fb069b133 100644
@@ -47,19 +47,19 @@ vsprintf, vsnprintf \- formatted output conversion
 .BI "int sprintf(char *restrict " str ,
 .BI "            const char *restrict " format ", ...);"
 .BI "int snprintf(char *restrict " str ", size_t " size ,
-.BI "            const char *restrict " format ", ...);"
+.BI "             const char *restrict " format ", ...);"
 .PP
 .B #include <stdarg.h>
 .PP
 .BI "int vprintf(const char *restrict " format ", va_list " ap );
 .BI "int vfprintf(FILE *restrict " stream ,
-.BI "            const char *restrict " format ", va_list " ap );
+.BI "             const char *restrict " format ", va_list " ap );
 .BI "int vdprintf(int " fd ,
-.BI "            const char *restrict " format ", va_list " ap );
+.BI "             const char *restrict " format ", va_list " ap );
 .BI "int vsprintf(char *restrict " str ,
-.BI "            const char *restrict " format ", va_list " ap );
+.BI "             const char *restrict " format ", va_list " ap );
 .BI "int vsnprintf(char *restrict " str ", size_t " size ,
-.BI "            const char *restrict " format ", va_list " ap );
+.BI "              const char *restrict " format ", va_list " ap );
 .fi
 .PP
 .RS -4
Signature · 1 line
2.34.1
#1 lore raw

Hi Mike,

Quoted 24 lines · Mike Frysinger
---
 man3/printf.3 | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
man3/printf.3 +2 -3
index 4fa1f11f3c25..e39fb069b133 100644
@@ -47,19 +47,19 @@ vsprintf, vsnprintf \- formatted output conversion
 .BI "int sprintf(char *restrict " str ,
 .BI "            const char *restrict " format ", ...);"
 .BI "int snprintf(char *restrict " str ", size_t " size ,
-.BI "            const char *restrict " format ", ...);"
+.BI "             const char *restrict " format ", ...);"
 .PP
 .B #include <stdarg.h>
 .PP
 .BI "int vprintf(const char *restrict " format ", va_list " ap );
 .BI "int vfprintf(FILE *restrict " stream ,
-.BI "            const char *restrict " format ", va_list " ap );
+.BI "             const char *restrict " format ", va_list " ap );
 .BI "int vdprintf(int " fd ,
-.BI "            const char *restrict " format ", va_list " ap );

man3/printf.3 vsprintf, vsnprintf \- formatted output conversion · line 65

Quoted 10 lines
man3/printf.3 +3 -2
+.BI "             const char *restrict " format ", va_list " ap );
 .BI "int vsprintf(char *restrict " str ,
-.BI "            const char *restrict " format ", va_list " ap );
+.BI "             const char *restrict " format ", va_list " ap );
 .BI "int vsnprintf(char *restrict " str ", size_t " size ,
-.BI "            const char *restrict " format ", va_list " ap );
+.BI "              const char *restrict " format ", va_list " ap );
 .fi
 .PP
 .RS -4

Those indents are intentional. See
<https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/commit/?id=f2667a721278baa6f3dda3a2a42e741ec7ba276b>.

And see man-pages(7):

FORMATTING AND WORDING CONVENTIONS
[...]

In the SYNOPSIS, a long function prototype may need to be continued over to the next line. The continuation line is indented according to the following rules:

1. [...]

2. But, where multiple functions in the SYNOPSIS require continuation lines, and the function names have dif‐ ferent lengths, then align all continuation lines to start in the same column. This provides a nicer ren‐ dering in PDF output (because the SYNOPSIS uses a variable width font where spaces render narrower than most characters). As an example:

int getopt(int argc, char * const argv[],
const char *optstring);
int getopt_long(int argc, char * const argv[],
const char *optstring,
const struct option *longopts, int *longindex);

Cheers,

Alex

Signature · 3 lines
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/