You can't pass on the variadic arguments. You have to fetch them into a va_list
and pass this to the inner function.
Take a look at this Question at the C FAQ. It defines a variadic error
function that wants to forward to printf
. This is just your use case.
In the same FAQs, it is generally recommended to have a version taking va_list
for every (or most) variadic functions