va_list is the C library type that represents traversal state for a variable argument list. Defined by <stdarg.h>, it is created with va_start, consumed with va_arg, and released with va_end. va_copy duplicates traversal state when an independent pass is needed. section 17.4.2
Forwarding arguments to formatted output
A wrapper can initialize a va_list, pass it unchanged to vfprintf, and then finish it: `va_list ap; va_start(ap, format); vfprintf(iodebug, format, ap); va_end(ap);`. This avoids manually retrieving and type-checking every argument. Before C23, va_start conventionally received the last named parameter; C23 permits omitting that second argument. section 17.4.2
The va_list interface supplies four operations:
- va_start initializes traversal state for the variable parameters. section 17.4.2
- va_arg retrieves the next argument using a requested type; the caller must know the argument types. section 17.4.2
- va_copy creates a separate traversal state, while va_end terminates an initialized list. section 17.4.2
Variadic functions are not type-safe by themselves: each supplied argument must match the type expected by the consumer. This is why forwarding to a v-prefixed library function is preferable to repeating argument analysis, and why new interfaces should generally avoid variadic functions. section 17.4.2 section 17.2
void va_start(va_list ap, ...);
void va_end(va_list ap);
\textit{type} va_arg(va_list ap, \textit{type});
void va_copy(va_list dest, va_list src);
Use the compact interface listing to compare va_start, va_arg, va_copy, and va_end. section 17.4.2

