🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3238

Re: Must main return a value?

#3238
From: Stephen Clamage
Date: Fri, 28 Jun 1991 16:46
17 lines
1049 bytes
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
Technical Details
Message-ID: <787@taumet.com>
Path: arc1-ca.pugleaf.net!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
References: <7830001@hpwrce.HP.COM> <1991Jun28.043342.27540@ptcburp.ptcbu.oz.au>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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