Doubts about va_list alignment
Hello,
the ethernut project
svn checkout svn://svn.
implements its own printf routines to be portable with compilers and architectures. With the launchpad toolchain we observe unexpected behaviour an AT91 and Cortex-M processors when pulling 64-bit units from the va_list, like
by either replacing above sequence with
if (*(uint32_t*)&ap & 4) {
}
}
or using a subroutine call like
double va_args_
return va_arg(*ap, double);
}
...
_double = va_args_
...
we can fix the issue. Looking at the assembler output for _double = va_arg(ap, double) we can see that ap is expected to be placed on a 8-byte boundary. If by chance ap is placed on odd 4 byte boundary things go astray.
Is this a problem with our setup of includes and compiler options or a general arm-gcc problem?
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Uwe Bonnes
- Solved:
- Last query:
- Last reply: