As long as you properly prototype the function (which BTW is required by ISO C
for varidic functions), egcs will pass everything on the stack. The code that
does this has been part of the egcs code base since the beginning (of egcs),
though Jeff Law did modify one of the lines on the second of November 1997.
I'm pretty sure I put in the check when I first did the regparm stuff 4+ years
ago for gcc 2.6.x, but I'm not motivated to really dig through the archives any
further.
However, your statement:
... the compiler NEEDS to fall back to stack passing
is only true as it concerns the x86 implementation of varargs. In the 12+
ports I've worked on with GCC, the majority of systems pass varadic arguments
in registers. Some of them in fact make the handling of varardic arguments
fairly complecated at runtime (the PowerPC System V ABI which is used in Linux
and eABI situations is an example of this).
Also, regarding the prototyping rule, I have worked on ports which pass
arguments completely differently for varadic functions as opposed to normal
functions, which means you must always include stdio.h for instance in order to
call printf.
-- Michael Meissner, Cygnus Solutions (Massachusetts office) 4th floor, 955 Massachusetts Avenue, Cambridge, MA 02139, USA meissner@cygnus.com, 617-354-5416 (office), 617-354-7161 (fax)- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/