You can’t, you can only pass the arguments as a va_list
. See the comp.lang.c FAQ.
In general, if you’re writing variadic functions (that is, functions which take a variable number of arguments) in C, you should write two versions of each function: one which takes an ellipsis (...
), and one which takes a va_list
. The version taking an ellipsis should call va_start
, call the version taking a va_list
, call va_end
, and return. There’s no need for code duplication between the two versions of the function, since one calls the other.