On Tue, Oct 17, 2000 at 07:42:31AM +0000, Peter Samuelson wrote:
> So, if you choose left-to-right, how do you implement varargs?  Keep in
> mind that prototypes are optional.  I bet anything your solution is
> slower and more complex than right-to-left, as all known compilers do.

Calling a varargs function with no prototype in scope is undefined
behavior.

For instance, when I designed a C calling convention in a class long
ago (for some mips-li[kt]e instruction set), I decided that the first
few arguments of normal functions would be passed in registers, but in
varargs functions all arguments would be passed on the stack.  This is a
perfectly legal under the C standard, even though calling printf without
a declaration visible would break.

Jeff
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/

Reply via email to