In C, is it possible to forward the invocation of a variadic function? As in,
int my_printf(char *fmt, ...) {
fprintf(stderr, \"Calling printf with fmt %
C99 supports macros with variadic arguments; depending on your compiler, you might be able to declare a macro that does what you want:
#define my_printf(format, ...) \
do { \
fprintf(stderr, "Calling printf with fmt %s\n", format); \
some_other_variadac_function(format, ##__VA_ARGS__); \
} while(0)
In general, though, the best solution is to use the va_list form of the function you're trying to wrap, should one exist.