From 2075615499122985689
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,314ebdf2ff957e27
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2003-04-16 12:51:33 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: ron@sensor.com ("Ron Natalie")
Newsgroups: comp.std.c++
Subject: Re: Why int main()?
Date: Wed, 16 Apr 2003 19:51:32 +0000 (UTC)
Lines: 43
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <Lbina.6887$Y57.3348@fe05.atl2.webusenet.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>
X-Trace: mail2news.demon.co.uk 1050522693 27660 10.0.0.1 (16 Apr 2003 19:51:33 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Wed, 16 Apr 2003 19:51:33 +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 195swN-0007Bz-00
	for mail2news@news.news.demon.net; Wed, 16 Apr 2003 19:51:32 +0000
X-Received: by mulga.cs.mu.OZ.AU
	id FAA26888; Thu, 17 Apr 2003 05:51:28 +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-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
X-Abuse-Info: Please be sure to forward a copy of ALL headers
X-Abuse-Info: Otherwise we will be unable to process your complaint properly.
X-NNTP-Posting-Date: Wed, 16 Apr 2003 15:30:51 EDT
X-Spam-Status: No, hits=-1.7 required=5.0
	tests=INVALID_MSGID,PRIORITY_NO_NAME,QUOTED_EMAIL_TEXT,
	      REFERENCES,SPAM_PHRASE_00_01
	version=2.41
Xref: archiver1.google.com comp.std.c++:18785


"Allan W" <allan_w@my-dejanews.com> wrote in message news:7f2735a5.0304161119.2d516e7d@posting.google.com...

> Suppose we insist that either main_t is a typedef for int, or else it
> is convertible from int. Most programs would need only one trivial
> change in order to be compatible; furthermore, on existing platforms,
> the code would continue to function properly until this change was made.

Great more godawful changes that make main different than every other
function.   This means more goofy stuff that has to get added to something
that knows it's compiling main and possibly additional linkage overhead
to support this.

> I've been a strong proponent of ignoring void main, even when the
> local platform supports it -- but my impression is that a LOT of
> people routinely use it, without even realizing it's wrong. Which
> makes me think that maybe we should support it after all. The C++
> standard is supposed to document existing practice, yes?

No.  The practice was wrong before, it is wrong now.   The C++ standard
only has a preference for things that were legal before, to avoid making them
illegal.   void main has never been legal in C or C++.   The fact that it
"happens to work OK" is not a compelling reason to codify the bad practice.

>
> Perhaps we should recognize any of these signatures:
>     int main(int, char**);
>     int main();
>     void main();

 The only reason that multiple signatures exist and are codified
in C++ is that early implementations worked fine when you passed unused
arguments.   People got used to not being required to declare argc and argv
if they didn't use them, so the bad practice was standardized.



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



