Populating a va_list

后端 未结 4 1059
花落未央
花落未央 2020-12-01 18:09

Is there a way to create a va_list from scratch? I\'m trying to call a function that takes a va_list as a parameter:

func(void **e         


        
4条回答
  •  北荒
    北荒 (楼主)
    2020-12-01 18:29

    I understand and agree with Aiden's warnings - va_list and friends are dangerous since they hide low-level calling conventions. But ... in this situation I think you have no other option. Put the static ... function into the .c file so nobody else can see it, sort of a proxy to the function you need to call, test the hell out of it, and be done. Just make sure you don't expose the variadic arguments up the call chain.

提交回复
热议问题