There is a function:
void some_function(int id,...);
question: is there a way to wrap this function? It means to get something like this:
void wrapped_some_function(int id,...)
{
//do smth
some_function(id,...);
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
With gcc,
__builtin_apply_argsand__builtin_apply, documented here, can do it.For standard C, there’s no way (what other answers suggest can work, but it isn’t 100% what you ask for).
But if there’s a variation of
some_functionthat getsva_list(likevprintfis a variation ofprintf), you can use it.