I have a c function that uses varadic arguments in a standard way, below a simplified example:
void func(parameter,...) {
va_list args;
va_start(args, parameter);
//process args
v1 = va_arg(args,sometype);
v2 = va_arg(args,sometype);
...
vn = va_arg(args,sometype);
va_end(args);
}
//call func
func(parameter, p1, p2, ..., pn);
On all armv7s devices and below, as well as on all simulators, including a 64-bit simulator, this succeeds, and the variable v1-vn is assigned to p1-pn, but when it runs on arm64, it looks like the variational list is reversed (v1 = pn, v2 = pn-1, ..., vn = p1)
Is there any fix for this? Or did I skip the documentation describing this change?
thanks
EDIT:
I did not mention a key element of this problem that I did not think to mention before. I tried to use non-invariant functions with a common variational function.
Note: the compiler used was Apple LLVM 5.0