🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3266

Re: Must main return a value?

#3266
From: Dan Bernstein
Date: Sun, 30 Jun 1991 04:44
25 lines
1755 bytes
In article <16587@smoke.brl.mil> gwyn@smoke.brl.mil (Doug Gwyn) writes:
> Given that anonymous return in general produces an unspecified value,
> anonymous return from main() naturally would do the same.

Hold on. You're saying something about the real world here, and the real
world doesn't distinguish between ``implementation-defined'' and
``undefined'' until a standard comes along and forces the issue. ANSI
could easily have left these decisions up to the implementation, and you
haven't given any excuse for the undefined behavior that wouldn't apply
equally well to implementation-defined behavior.

Or are you claiming that ANSI never forced implementations to define
behaviors where the behavior in general produced unspecified effects? I
think not. If that were so, ``implementation-defined'' wouldn't even be
in the standard. Everything would be ``undefined.''

> While you can argue that you would like to add some more default rules
> such as automatic 0 values for anonymous returns,

Yikes, why would I argue for something like that? I was just giving an
example of what an implementation could do to define the value. Nobody
in his right mind would standardize such a rule when it breaks so many
existing implementations for no good reason.

---Dan
Technical Details
Message-ID: <16020.Jun3004.44.3491@kramden.acf.nyu.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!cmcl2!kramden.acf.nyu.edu!brnstnd
References: <16582@smoke.brl.mil> <12049.Jun2922.08.1391@kramden.acf.nyu.edu> <16587@smoke.brl.mil>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!cmcl2!kramden.acf.nyu.edu!brnstnd
From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein)
Newsgroups: comp.std.c
Subject: Re: Must main return a value?
Message-ID: <16020.Jun3004.44.3491@kramden.acf.nyu.edu>
Date: 30 Jun 91 04:44:34 GMT
References: <16582@smoke.brl.mil> <12049.Jun2922.08.1391@kramden.acf.nyu.edu> <16587@smoke.brl.mil>
Organization: IR
Lines: 25