Path: utzoo!attcan!uunet!cs.utexas.edu!sdd.hp.com!usc!elroy.jpl.nasa.gov!jato!mars!kaleb From: kaleb@mars.jpl.nasa.gov (Kaleb Keithley) Newsgroups: comp.lang.c Subject: Re: main() arguments, was Re: typedef-ing an array Message-ID: <4249@jato.Jpl.Nasa.Gov> Date: 5 Jul 90 18:06:43 GMT References: <4238@jato.Jpl.Nasa.Gov> <25273@mimsy.umd.edu> <4241@jato.Jpl.Nasa.Gov> <2160@polari.UUCP> Sender: news@jato.Jpl.Nasa.Gov Reply-To: kaleb@mars.UUCP (Kaleb Keithley) Organization: Jet Propulsion Laboratory, Pasadena, CA. Lines: 29 In article <2160@polari.UUCP> 6sigma2@polari.UUCP (Brian Matthews) writes: >In article <4241@jato.Jpl.Nasa.Gov> kaleb@mars.UUCP (Kaleb Keithley) writes: >|void main () { exit(0); printf("I'll never be printed\n"); } > >In general, trying an example that happens to work one way on one compiler >shouldn't be convincing. > >In this case, proof (for ANSI C) would consist of quoting the standard >where it says "The exit function cannot return to its caller." Well, I tried it on as many compilers as I could get my hands on, and they all worked. I'd call that *empirical* proof. As opposed to the other, which walk, talks, and smells like a theoretical proof. In the world where I work, the doc's, standards, and manuals frequently say one thing, while the actual tool does something else. So I've come to rely on not taking "...the book says..." as gospel. Don't get me wrong, I support the standard, even though I have shown that I'm not very familiar with it. (I learned something in this little exchange also!) It also strikes me that what may be missing from the standard is a statement along the lines of "... use of exit() from main() is illegal..." Not to mention that K&R2 is a little misleading in this area also. kaleb@thyme.jpl.nasa.gov Jet Propeller Labs Kaleb Keithley "So that's what an invisible barrier looks like"