tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Merging patches...


From: Daniel Glöckner
Subject: Re: [Tinycc-devel] Merging patches...
Date: Mon, 9 Oct 2006 20:00:31 +0200
User-agent: Mutt/1.4.2.1i

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 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]