Bug 216461 - Misleading synposis in printf(3) for vsnprintf(3)
Summary: Misleading synposis in printf(3) for vsnprintf(3)
Status: NEW
Alias: None
Product: Documentation
Classification: Unclassified
Component: man-pages (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: documentation_man-pages@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-08 01:42 UTC by Sam James
Modified: 2022-09-08 01:42 UTC (History)
0 users

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments

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!

Note You need to log in before you can comment on or make changes to this bug.