Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!husc6!think!ames!ucbcad!ucbvax!ulysses!hector!jss From: jss@hector.UUCP Newsgroups: comp.lang.c Subject: Re: Function prototypes versus open() Message-ID: <2619@ulysses.homer.nj.att.com> Date: Fri, 29-May-87 16:40:27 EDT Article-I.D.: ulysses.2619 Posted: Fri May 29 16:40:27 1987 Date-Received: Sat, 30-May-87 11:29:18 EDT References: <18346@ucbvax.BERKELEY.EDU> <8042@utzoo.UUCP> <2210@hoptoad.uucp> Sender: daemon@ulysses.homer.nj.att.com Reply-To: jss@hector (Jerry Schwarz) Organization: AT&T Bell Labs, Murray Hill Lines: 27 In article <2210@hoptoad.uucp> gnu@hoptoad.uucp (John Gilmore) writes: >I think I've found a problem with the C standard. (greek chorus: >It says that functions with variable numbers of "so what else >arguments cannot be called unless a function is new?") >prototype is in scope. > >It seems that if a compiler really believed the restriction in the >draft standard, it would not be able to correctly compile many Unix >programs which haven't heard of three operand open() or . It is not a restriction on the compiler (or compiler writer), it is a requirement on the (application) programmer. The intention, as I read it, is to allow a C compilation system to use a different calling sequence for functions with known numbers of arguments and those (like printf) with variable numbers of arguments. Whether this is desirable will depend on pragmatic considerations, such as the overheads associated with permitting variable numbers of arguments. I doubt that any UNIX compiler will be written that varies its calling sequences in this way, but I could be wrong. At least the ANSI standard requires compilation systems to have some way to deal with functions that are called with varying numbers of arguments. This was not required by K&R. (Although a C compilation system that didn't support "printf" would probably not have many users.) Jerry Schwarz