On Sun, Oct 08, 2006 at 11:49:53PM -0400, Rob Landley wrote:
> Would someone please explain to me why stdarg.h says the va_args macros
> are "only correct for i386", but we have an arm eabi patch pending that
> doesn't touch this file? Which is wrong?
The both are wrong.
The macros are correct for non-EABI ARM as well.
EABI ARM needs something like:
#define va_arg(ap,type) ( \
*(type *)((ap = (va_list)((ap + (((sizeof(type) + 3) & ~3) \
+ (__alignof__(type) > 4) \
* (__alignof__(type) - 1)) \
- (va_list)0) \
& - (1 + (__alignof__(type) > 4) \
* (__alignof__(type) - 1)))) \
- ((sizeof(type) + 3) & ~3)))
This "thing" generates the shortest instruction sequence.
Feel free to reformat it :-)
Daniel
_______________________________________________
Tinycc-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/tinycc-devel