Is GCC mishandling a pointer to a va_list passed to a function?

后端 未结 4 1409
日久生厌
日久生厌 2020-11-30 08:48

The question \'Pass va_list or pointer to va_list?\' has an answer which quotes the standard (ISO/IEC 9899:1999 - §7.15 \'Variable arguments , f

4条回答
  •  孤城傲影
    2020-11-30 09:09

    I think va_list must be declared as an array type, which “boils down” to a pointer type when declared as a parameter of a function. Therefore, the & applied to the va_list type in test_val yields a pointer to a pointer type, not a pointer to an array type, however, the test_ptr function declares one of its parameters as a pointer to array type, which is what is actually provided in the test function.

提交回复
热议问题