From 8647049466386603624 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f78e5,a7bb6560624ae2c1 X-Google-Attributes: gidf78e5,public From: Matt Austern Subject: Re: More M$ Not Conforming points... Date: 1999/08/25 Message-ID: #1/1 X-Deja-AN: 517130847 Approved: Fergus Henderson References: <7ps1sg$dev$1@nnrp1.deja.com> <7pu4es$1mv3$1@news.hal-pc.org> X-Original-Date: 24 Aug 1999 14:03:08 -0700 X-Complaints-To: news@news.unimelb.edu.au X-Trace: izvestia.its.unimelb.edu.au 935607715 3650 128.250.29.17 (25 Aug 1999 19:01:55 GMT) Organization: SGI X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUAN8Q9iOEDnX0m9pzZAQED6QF+KVCPnsQoIU2t1ni7eoRLnaCPp7zND6LE uFS+TmR/8qkyu5YG9/rAtkqGd7qnLG2d =hJUf NNTP-Posting-Date: 25 Aug 1999 19:01:55 GMT Newsgroups: comp.std.c++ "Greg Brewer" writes: > > int main (void) { } > > VC++ produces the following warning: > > warning C4508: 'main' : function should return a value; 'void' return > > type assumed > > > > "void return type assumed" ???? What ? void assumed? > > This warning is no different than any other function without a return. I > think you will find that if you change it to > void main(void) {} > it will compile without any complaints. Yes, that's the problem. The warning suggests that you take a legal program (3.6.1/5: "If control reaches the end of main without encountering a return statement, the effect is that of executing return 0;") and turn it into an illegal program. (3.6.1/2: "An implementation shall not predefine the main function... It shall have a return type of int.") --- [ 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://reality.sgi.com/austern_mti/std-c++/faq.html ]