How to use va_list correctly in a sequence of wrapper functions calls?

前端 未结 1 942
萌比男神i
萌比男神i 2021-01-26 11:44

I have an ethernet library for microcontroller (keil rl-tcpnet for lpc2478). Library uses va_list (standard pointer to arg array macro defined in stdarg.h) in debug output funct

1条回答
  •  星月不相逢
    2021-01-26 11:55

    You can't pass va_list to a function expecting ..., unless that function (of course) expects a va_list in the variable-arguments part. Your code clearly does not.

    You need to explicitly accept a va_list argument into printDebugMsg(), since that's what you're passing. See for instance vprintf() which solves this problem for the printf() family.

    0 讨论(0)
提交回复
热议问题