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).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-01-27 12:56 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-01-27 2:12 PM
Works here. Can you provide a more complete example demonstrating the behaviour?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-01-27 3:58 PM
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 !
