data-alignment issues in varargs function

OP #1792250
Rate this post
• ▲ useful
▼ not useful
I have a data-conversion function in our ARM9 code which uses varargs. 
I've been using an arm-elf yagarto distribution from a couple of years 
ago, with no problems.  Recently, we upgraded to the arm-eabi-none 
yagarto package from the yagarto site, and I'm finding that we now have 
problems with floating point values.  What I eventually discovered is 
that doubles are being forced to 8-byte boundaries, and the existing 
varargs floating-point handler didn't expect to find gaps in the args.

I can manually check the pointer and force it up to an eight-byte 
boundary (in fact, I did that, and that fixed the issue entirely), but 
I'd like to know why this has suddenly started happening.

Is there a compiler switch that specifies data alignment on the stack, 
or in function calls, or something like that??  And why would it be 
defaulting to 8-byte boundaries on a 32-bit (4-byte) architecture??

I would appreciate any advice or insights that anyone could provide on 
these issues.

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.