Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!ccu.umanitoba.ca!herald.usask.ca!alberta!ubc-cs!uw-beaver!cornell!batcomputer!caen!zaphod.mps.ohio-state.edu!samsung!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.std.c Subject: Re: Must main return a value? Message-ID: <787@taumet.com> Date: 28 Jun 91 16:46:19 GMT References: <7830001@hpwrce.HP.COM> <1991Jun28.043342.27540@ptcburp.ptcbu.oz.au> Organization: Taumetric Corporation, San Diego Lines: 17 michi@ptcburp.ptcbu.oz.au (Michael Henning) writes: >The upshot is that the program is strictly conforming, but the exit >status the OS gets to see is undefined. No. A strictly-conforming program "shall not produce output dependent on any unspecified, undefined, or implementation-defined behavior" (section 1.7). >So it pays to write >int main(void) { exit(0); } Except that EXIT_SUCCESS need not have the value 0. This might be wrong in an ANSI environment. -- Steve Clamage, TauMetric Corp, steve@taumet.com