Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!husc6!think!ames!oliveb!sun!gorodish!guy From: guy%gorodish@Sun.COM (Guy Harris) Newsgroups: comp.lang.c Subject: Re: Function prototypes versus open() Message-ID: <22194@sun.uucp> Date: Fri, 26-Jun-87 15:22:23 EDT Article-I.D.: sun.22194 Posted: Fri Jun 26 15:22:23 1987 Date-Received: Sat, 27-Jun-87 10:48:36 EDT References: <18346@ucbvax.BERKELEY.EDU> <8042@utzoo.UUCP> <2210@hoptoad.uucp> <821@mcgill-vision.UUCP> Sender: news@sun.uucp Lines: 24 > Well, I don't know about the AT&T implementation, but the BSD open() > most emphatically does not have an optional third argument! It has > three, exactly three, arguments. It just happens that on most BSD > machines, you can get away with passing fewer arguments that the > routine wants provided it ignores the extra ones. The BSD implementation very closely resembles the System III/System V implementation, so the argument is as optional in one as it is in the other. > This means that you can get away with pretending it's optional, but that > doesn't make it optional at all. Wait for the day you have to port to a > machine whose compiler treats optional arguments differently - it'll be > the day this burns you. Actually, it'll be the day it burns the person who ports UNIX to that machine; "open()" used to take two arguments, and there are plenty of programs left around that weren't changed when "open" was changed. This is, I presume, why Karl Heuer complained about the 3-argument "open"; introducing it technically rendered *all* programs that used a two-argument "open" invalid! Guy Harris {ihnp4, decvax, seismo, decwrl, ...}!sun!guy guy@sun.com