lkml.org 
[lkml]   [2000]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Patch to remove undefined C code
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 majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:41    [W:0.074 / U:3.848 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site