Bug 216461

Summary: Misleading synposis in printf(3) for vsnprintf(3)
Product: Documentation Reporter: Sam James (sam)
Component: man-pagesAssignee: documentation_man-pages (documentation_man-pages)
Status: NEW ---    
Severity: normal    
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: Subsystem:
Regression: No Bisected commit-id:

Description Sam James 2022-09-08 01:42:59 UTC
Hi!

The printf(3) page says:
```
SYNOPSIS
       #include <stdio.h>

       int printf(const char *restrict format, ...);
[...]

       #include <stdarg.h>

       int vprintf(const char *restrict format, va_list ap);
[...]
       int vsnprintf(char *restrict str, size_t size,
                   const char *restrict format, va_list ap);
```

It might just be me, but the gap between the two blocks of functions made me think that only <stdarg.h> was needed for those latter functions, even though it's needed for va_list.

Would it be appropriate to add a second #include <stdio.h> above #include <stdarg.h> to resolve the ambiguity?

Thanks!