Path: utzoo!utgpu!watserv1!watmath!att!rutgers!cs.utexas.edu!rice!uw-beaver!sumax!polari!6sigma2 From: 6sigma2@polari.UUCP (Brian Matthews) Newsgroups: comp.lang.c Subject: Re: main() arguments, was Re: typedef-ing an array Message-ID: <2169@polari.UUCP> Date: 6 Jul 90 04:01:08 GMT References: <4241@jato.Jpl.Nasa.Gov> <2160@polari.UUCP> <4249@jato.Jpl.Nasa.Gov> Organization: Seattle Online Public Unix (206) 328-4944 Lines: 30 In article <4249@jato.Jpl.Nasa.Gov> kaleb@mars.UUCP (Kaleb Keithley) writes: |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. |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. Empirical evidence that it works on the compilers you could get your hands on. If you want to know if something conforms to the standard or not, your only choice is to consult the standard. Of course, as you say, knowing something conforms to the standard is no proof that it actually compiles correctly on any compiler. |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!) Good! Another happy customer :-) |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. But the whole point of the discussion is that an exit from main isn't illegal and will do the same thing as a return from main (with the same value, of course) as long as main is declared correctly. -- Brian L. Matthews blm@6sceng.UUCP