From -5896485027081346273
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,314ebdf2ff957e27
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2003-04-24 13:55:25 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!kibo.news.demon.net!mutlu.news.demon.net!demon!mail2news.demon.co.uk!devnull
From: allan_w@my-dejanews.com (Allan W)
Newsgroups: comp.std.c++
Subject: Re: Why int main()?
Date: Thu, 24 Apr 2003 20:55:24 +0000 (UTC)
Organization: http://groups.google.com/
Lines: 28
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <7f2735a5.0304241249.2bdc086e@posting.google.com>
References: <Qbvla.955$5Z2.28625@newsfep1-win.server.ntli.net> <RkkxdPDmqwl+Ewp6@robinton.demon.co.uk> <3E9821CE.8AC8B8C6@web.de> <d6651fb6.0304150039.67fdce42@posting.google.com> <7f2735a5.0304161119.2d516e7d@posting.google.com> <Lbina.6887$Y57.3348@fe05.atl2.webusenet.com> <d6651fb6.0304230831.57a6e4f6@posting.google.com> <3EA7067C.BD7A6968@unet.univie.ac.at>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: mail2news.demon.co.uk 1051217724 9343 10.0.0.1 (24 Apr 2003 20:55:24 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Thu, 24 Apr 2003 20:55:24 +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 198nkY-0002QY-00
	for mail2news@news.news.demon.net; Thu, 24 Apr 2003 20:55:23 +0000
X-Received: from localhost (localhost [[UNIX: localhost]]) by mulga.cs.mu.OZ.AU
	id GAA26987; Fri, 25 Apr 2003 06:55:11 +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: 24 Apr 2003 20:49:47 GMT
X-Spam-Status: No, hits=-7.4 required=5.0
	tests=MAILTO_TO_SPAM_ADDR,NOSPAM_INC,QUOTED_EMAIL_TEXT,
	      REFERENCES,SPAM_PHRASE_00_01
	version=2.41
Xref: archiver1.google.com comp.std.c++:18945

a9804814@unet.univie.ac.at (Thomas Mang)
> A point against "void main()":
> It violates the overloading rules because we'd have then 2
> functions differing only in the return type.

3.6.1/2 ... the main function... shall not be overloaded.

> OTOH, main is special anyways, why not make it special regarding this too,
> since there is hardly an ambiguity to expect in practice........

Can you imagine what would happen if a program had two global functions
named main()?
    int main()            { std::cout << "Version 1" << endl; }
    int main(int, char**) { std::cout << "Version 2" << endl; }

If the implementation manages different signatures for main by using
the assembly-language concept called "weak references", then it will
end up calling whichever version of main that the start-up code
happens to check first. (Or maybe it calls BOTH of them, one after
the other!) If it uses some other technique, maybe it gets a linker
error. Otherwise I have no idea what to expect -- no, not a clue.

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



