cancel
Showing results for 
Search instead for 
Did you mean: 

Does the STM32 v1.5.1 GCC 7.3.1 toolchain have a limitation of 32-bit arguments for variable argument lists (stdarg.h) ? I am trying to pass 64-bit arguments via a variable argument list and I only see the upper 32-bits set (lower 32-bits are zero).

MNeed.1
Associate

I'm using the standard ANSI va_args approach here:

int64_t arg64 = va_arg(args, int64_t);

When stepping through the code the debugger clearly shows me a value like: 0xbeefbeef00000000

2 REPLIES 2
KnarfB
Principal III

Works here. Can you provide a more complete example demonstrating the behaviour?

MNeed.1
Associate

Oh I figured it out... This is a good one .... Turns out varargs with ARM32 and the GCC compiler (only?) requires the stack frame to be aligned at a 8 byte boundary. I was creating my own stack frames and everything else was working -- in fact for a long time. That is until I tried 64-bit varargs. Also check out: https://github.com/boostorg/context/pull/47 . Thanks for your time !