From 7503875729560510401
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,314ebdf2ff957e27
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2003-04-11 13:03:50 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: Fri, 11 Apr 2003 20:03:48 +0000 (UTC)
Lines: 27
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <i1Fla.21842$eo4.9547@fe10.atl2.webusenet.com>
References: <Qbvla.955$5Z2.28625@newsfep1-win.server.ntli.net> <1050087548.757301@hqnntp01.autodesk.com>
X-Trace: mail2news.demon.co.uk 1050091429 29773 10.0.0.1 (11 Apr 2003 20:03:49 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Fri, 11 Apr 2003 20:03:49 +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 1944kV-0007k4-00
	for mail2news@news.news.demon.net; Fri, 11 Apr 2003 20:03:47 +0000
X-Received: from localhost (localhost [[UNIX: localhost]]) by mulga.cs.mu.OZ.AU
	id GAA26488; Sat, 12 Apr 2003 06:03:44 +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: Fri, 11 Apr 2003 15:51:42 EDT
X-Spam-Status: No, hits=2.8 required=5.0
	tests=INVALID_MSGID,MAILTO_TO_SPAM_ADDR,PRIORITY_NO_NAME,
	      REFERENCES,SPAM_PHRASE_00_01
	version=2.41
X-Spam-Level: **
Xref: archiver1.google.com comp.std.c++:18741


""Chris Putnam"" <nospam42@attbi.com> wrote in message news:1050087548.757301@hqnntp01.autodesk.com...

> In my experience, compilers that accept the void main() signature do so by
> providing a wrapper function to match whatever signature the OS requires.

Not in my experience.   In my experience it is because the way the subroutine
linkage works, you can get away with mixing up void and int returns.   Typically
an int return is just a value in one of the general purpose registers so the only
difference is the setting or omitting setting a value in the register.

It's just sheer luck that it works.   Try this:

    struct {
        char x[100];
    } main() {
     }

and see what happens.


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



