Hi, I'd like to know if this will do what I expect on all platforms (standard C99):
Of course what I expect is "arguments" not to be corrupted when it is passed to foo2. I suppose it is OK or else there is a serious problem with the name of this macro, but you never know .
void foo1(va_list arguments)
... some code using va_arg on arg_copy and not on arguments ...
void foo2(va_list arguments)
... some code using va_arg on arg_copy and not on arguments ....
void foo(int count, ...)
None of the exemples about va_copy I found treat this particular point, which made me wonder if there is a better way to do it. And considering that I didn't find much information about the various implementation of the va_list type and the va_arg macro, except that there are precisly various ones, that do not always get along with assignations and such (array of pointers of length 1 I think for example) I am rather unsure of this code.
EDIT: sorry about the incorrect code, shouldn't try to learn 3 different things at the same time .