From -1425014059464098068
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,314ebdf2ff957e27
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2003-04-17 10:44:39 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!kibo.news.demon.net!mutlu.news.demon.net!demon!mail2news.demon.co.uk!devnull
From: algrant@myrealbox.com (Al Grant)
Newsgroups: comp.std.c++
Subject: Re: Why int main()?
Date: Thu, 17 Apr 2003 17:44:39 +0000 (UTC)
Organization: http://groups.google.com/
Lines: 28
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <5765b025.0304162335.536cf0ec@posting.google.com>
References: <Qbvla.955$5Z2.28625@newsfep1-win.server.ntli.net> <RkkxdPDmqwl+Ewp6@robinton.demon.co.uk> <DaGla.19630$ey1.1684332@newsread1.prod.itd.earthlink.net> <9k6f9vkh1959gdaln74lutrdbv9kr9rq0c@4ax.com> <G1Vma.8270$88.2789@fe07.atl2.webusenet.com> <3e9dc9fd$0$4860$ed9e5944@reading.news.pipex.net>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: mail2news.demon.co.uk 1050601479 2332 10.0.0.1 (17 Apr 2003 17:44:39 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Thu, 17 Apr 2003 17:44:39 +0000 (UTC)
X-Received: from mulga.cs.mu.oz.au ([128.250.1.22])
	by news.demon.co.uk with esmtp (Exim 4.12)
	id 196DR7-0000bT-00
	for mail2news@news.news.demon.net; Thu, 17 Apr 2003 17:44:38 +0000
X-Received: by mulga.cs.mu.OZ.AU
	id DAA09409; Fri, 18 Apr 2003 03:44:35 +1000 (EST)
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Path: comp-std-cpp-robomod!not-for-mail
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Delivered-To: std-c++@ucar.edu
X-Newsgroups: comp.std.c++
X-NNTP-Posting-Date: 17 Apr 2003 07:35:05 GMT
X-Spam-Status: No, hits=-8.4 required=5.0
	tests=NOSPAM_INC,QUOTED_EMAIL_TEXT,REFERENCES,SPAM_PHRASE_00_01
	version=2.41
Xref: archiver1.google.com comp.std.c++:18789

SPAMstephen.howeGUARD@tnsofres.com ("Stephen Howe") wrote in message news:<3e9dc9fd$0$4860$ed9e5944@reading.news.pipex.net>...
> I for one would sanction that main has to have a return statement in the
> next standard. There is absolutely _NO_ good reason why main cannot behave
> just like other functions if at all possible (I know it is special).
> Dropping "off the bottom" of main is appalling and I am amazed that was
> retained in the standard when implicit int was removed.

Right, there is no good reason why main cannot behave just like
other functions.  But it is other functions that need fixing.
E.g. consider

   void g(void);
   int f(bool b) { if (b) return 1; g(); }

Should this be legal?  Sure, if g() calls exit(), or longjmp(),
or throws an exception, or goes into an infinite loop.
The committee seem to have tentatively grasped the concept of
"non standard returns" in the context of main without accepting
its utility in general.  Some compilers already provide a 
"no return" annotation - evidently useful for the real world,
so why not add it to the language?

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]



