Accessing non-existing varargs argument
Richard Earnshaw
rearnsha@arm.com
Mon Dec 15 11:39:00 GMT 2014
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.
>> What problem are you trying to tackle here Florian?
>
> I want a simple and robust fix for this glibc bug:
>
> <https://sourceware.org/bugzilla/show_bug.cgi?id=17523>
>
> Summary: Kernel and glibc disagree when the mode argument is needed. I
> don't like to special-case O_CREAT, O_TMPFILE, and potential other flag
> combinations.
>
More information about the Gcc-help
mailing list