Accessing non-existing varargs argument

Oleg Endo oleg.endo@t-online.de
Mon Dec 15 17:25:00 GMT 2014


On Mon, 2014-12-15 at 11:39 +0000, Richard Earnshaw wrote:
> On 12/12/14 23:50, Florian Weimer wrote:
> > On 12/12/2014 08:02 PM, Jeff Law wrote:
> > 
> >> It'd probably work for the specific cases Florian wants to tackle, but
> >> I'd consider it highly non-portable.
> > 
> > I agree, that's why I asked for something “GCC-portable”.
> > 
> 
> Don't go this way.  Seriously, you can't assume that a future platform
> ABI won't break if you do.  ABI's at this level really aren't controlled
> by GCC, which just has to conform to whatever the platform ABI requires.
>  We were very close in AArch64 to defining the ABI for variadics to push
> all variadic (from the ... onwards) arguments onto the stack - it leads
> to a very simple ABI from an implementation viewpoint and eliminates
> much of the grotty code around reconstructing the parameter list.

FYI, that's what the Renesas ABI does on SH.  Makes capturing and
forwarding va arg lists more efficient.

Cheers,
Oleg



More information about the Gcc-help mailing list