vararg stdarg with 64 bit values
Asked by
Jeff Senn
I'm having trouble passing 'long long' or 'double' through a vararg function on a 32-bit ARM system raw hardware build.
Not only is the value wrong, but also following arg values.
Current downloaded binary build of the compiler 6.3.1
-march=armv7-a -mtune=cortex-a8 -mfpu=neon -ftree-vectorize -ffast-math -mfloat-abi=softfp -mcpu=cortex-a8
Can anyone verify it works for them?
e.g.
#include <stdarg.h>
long vartest(char *foo, ...) {
long long x;
long y;
va_list va;
va_start(va, foo);
x = va_arg(va, long long);
y = va_arg(va, long);
va_end(va);
return y;
}
int test() {
long long x = 0x300000002;
long y = 0x7;
long r = vartest("foo",x,y); //r will be incorrect
return r;
}
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Jeff Senn
- Solved:
- Last query:
- Last reply:
To post a message you must log in.