Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

vprintf / vfprintf / vsnprintf / vdprintf / vasprintf - glibc

Split from the chapter glibc: stdio and Formatted I/O into the per-function layout; see the method page and the glibc ledger for coverage status.

FieldValue
IDGLIBC-vprintf (group)
Headerstdio.h
ProvenanceISO C99 (introduced there, earlier GNU extensions, manual); POSIX.1-2008 (vdprintf); GNU (vasprintf)
Statusdocumented

The v... family takes a va_list instead of ... so user functions can forward their own arguments. Target mapping:

FunctionTargetReturn
vprintfstdoutchars or negative
vfprintfstreamchars or negative
vsprintfstring, unboundedchars
vsnprintfstring, size boundedwould-be length
vdprintffile descriptorbytes or negative
vasprintfmalloc’d string via *ptrlength or negative

Notes – a va_list is consumed by one call; re-walking requires va_copy (manual, Variable Arguments Output Functions). Use the v form to wrap formatting behind logging functions; pair with the format(printf, 2, 0)-style attributes for checking.