Is there a way to create a va_list
from scratch? I\'m trying to call a function that takes a va_list
as a parameter:
func(void **e
Your stupid_func
is perfectly valid C code, otherwise how would you supposedly call vprintf
and similar functions?
The glib library make use of these wrappers extensively. The C99 specification itself has something similar in the examples. Excerpt from section 7.19.6.8:
The following shows the use of the vfprintf function in a general error-reporting routine.
#include
#include void error(char *function_name, char *format, ...) { va_list args; va_start(args, format); // print out name of function causing error fprintf(stderr, "ERROR in %s: ", function_name); // print out remainder of message vfprintf(stderr, format, args); va_end(args) }