From 2488622406228612039
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,314ebdf2ff957e27
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2003-04-11 22:10:20 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!kibo.news.demon.net!mutlu.news.demon.net!demon!mail2news.demon.co.uk!devnull
From: jackklein@spamcop.net (Jack Klein)
Newsgroups: comp.std.c++
Subject: Re: Why int main()?
Date: Sat, 12 Apr 2003 05:10:19 +0000 (UTC)
Organization: AT&T Worldnet
Lines: 42
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <9k6f9vkh1959gdaln74lutrdbv9kr9rq0c@4ax.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>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: mail2news.demon.co.uk 1050124220 2280 10.0.0.1 (12 Apr 2003 05:10:20 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Sat, 12 Apr 2003 05:10:20 +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 194DHO-0000ad-00
	for mail2news@news.news.demon.net; Sat, 12 Apr 2003 05:10:18 +0000
X-Received: from localhost (localhost [[UNIX: localhost]]) by mulga.cs.mu.OZ.AU
	id PAA11601; Sat, 12 Apr 2003 15:10:09 +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-Newsreader: Forte Agent 1.9/32.560
X-NNTP-Posting-Date: Sat, 12 Apr 2003 04:51:13 GMT
X-Spam-Status: No, hits=-11.0 required=5.0
	tests=NOSPAM_INC,QUOTED_EMAIL_TEXT,REFERENCES,
	      SIGNATURE_SHORT_DENSE,SPAM_PHRASE_00_01
	version=2.41
Xref: archiver1.google.com comp.std.c++:18744

On Fri, 11 Apr 2003 22:54:02 +0000 (UTC), jdennett@acm.org (James
Dennett) wrote in comp.std.c++:

> Francis Glassborow wrote:
> > In article <Qbvla.955$5Z2.28625@newsfep1-win.server.ntli.net>, Huw Ford 
> > <Huw@Tesco.net> writes
> > 
> >> A lot of compilers will accept "void main()" so why must main return 
> >> an int?
> > 
> > 
> > Because Standards are about portability. It is easy for a system to 
> > ignore a return value when it does not need one, it is much harder to 
> > create one where it is needed and none has been provided.
> 
> And yet there's a wart in C++ because main is the _only_
> function returning int where we do not have to providfe a
> return value when the function exits, as a default value
> is indeed provided.

In the opinion of many, myself included, that was a mistake.  It
appears to me to be a sop to those who whined about having to type a
"return 0;".  At that it was better than standardizing "void main()",
and of course there might be other reasons I am not aware of.

Sadly, the C standard has done this as well, with even less
justification, as main() is not unique in C the way it is in C++.

-- 
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq

---
[ 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                       ]



