🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3246

Re: Must main return a value?

#3246
From: Doug Gwyn
Date: Fri, 28 Jun 1991 19:34
9 lines
1047 bytes
In article <7830001@hpwrce.HP.COM> walterm@hpwrce.HP.COM (Walter Murray) writes:
>Many people have written that the main function must return a value.
>I can't find such a requirement in the Standard.  I have read 2.1.2.2.3
>and 3.6.6.4.  Am I missing something?

You must be -- 2.1.2.2.3 states explicitly "If the main function executes a
return that specifies no value, the termination status returned to the host
environment is undefined."  That meets the condition for causing undefined
behavior on at least two counts.
Technical Details
Message-ID: <16575@smoke.brl.mil>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!ccu.umanitoba.ca!herald.usask.ca!alberta!brazeau.ucs.ualberta.ca!unixg.ubc.ca!ubc-cs!van-bc!zaphod.mps.ohio-state.edu!qt.cs.utexas.edu!yale.edu!cmcl2!adm!smoke!gwyn
References: <7830001@hpwrce.HP.COM>

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!brazeau.ucs.ualberta.ca!unixg.ubc.ca!ubc-cs!van-bc!zaphod.mps.ohio-state.edu!qt.cs.utexas.edu!yale.edu!cmcl2!adm!smoke!gwyn
From: gwyn@smoke.brl.mil (Doug Gwyn)
Newsgroups: comp.std.c
Subject: Re: Must main return a value?
Message-ID: <16575@smoke.brl.mil>
Date: 28 Jun 91 19:34:01 GMT
References: <7830001@hpwrce.HP.COM>
Organization: U.S. Army Ballistic Research Laboratory, APG, MD.
Lines: 9