delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/18/20:46:57

From: mert0407 AT sable DOT ox DOT ac DOT uk (George Foot)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Newbie question (error that needs cc1plus.exe file)
Date: 18 May 1997 13:54:29 GMT
Organization: Oxford University, England
Lines: 17
Message-ID: <5ln1ml$2p4@news.ox.ac.uk>
References: <19970517125400 DOT IAA20150 AT ladder02 DOT news DOT aol DOT com> <337E4F73 DOT 36E3 AT cs DOT com>
NNTP-Posting-Host: sable.ox.ac.uk
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

John M. Aldrich (fighteer AT cs DOT com) wrote:

: And, of course, add a "return 0;" at the end of main().

Is this strictly necessary? I was glancing through the ANSI standard the
other day (as one does) and it said that if main() reaches the end of the
function without encountering a return statement, it should assume a
return value of 0. Now gcc complains about this; is this non-compliance? 

I still think it's a good idea to put a return in anyway, for the same
reason I prototype all my functions and assign them return types.

-- 
George Foot <mert0407 AT sable DOT ox DOT ac DOT uk>
Merton College, Oxford

PS What should I do with the gold and platinum bars in dunnet? :)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019