Path: utzoo!attcan!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c Subject: Re: main() arguments, was Re: typedef-ing an array Message-ID: <306@taumet.com> Date: 6 Jul 90 17:39:32 GMT References: <4238@jato.Jpl.Nasa.Gov> <25273@mimsy.umd.edu> <4241@jato.Jpl.Nasa.Gov> <2160@polari.UUCP> <4249@jato.Jpl.Nasa.Gov> Reply-To: steve@taumet.UUCP (Stephen Clamage) Organization: Taumetric Corporation, San Diego Lines: 20 In article <4249@jato.Jpl.Nasa.Gov> kaleb@mars.UUCP (Kaleb Keithley) writes: >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..." Such a statement is not only not missing, but the standard says the opposite (section 2.1.2.2): "A return from the initial call to the _main_ function is equivalent to calling the _exit_ function with the value returned by the _main_ function as its argument." Once again, the point of all of this is that the standard represents a contract between the C compiler implementor and the C programmer. The implementor promises that the system will behave according to the standard if the programmer writes code according to the standard. The programmer is free to write code some other way, but he cannot then expect his code to work the same way when he tries it with some other compiler. -- Steve Clamage, TauMetric Corp, steve@taumet.com