From: "John M. Aldrich" Newsgroups: comp.os.msdos.djgpp Subject: Re: Warning message Date: Tue, 05 Aug 1997 21:55:47 +0000 Organization: Two pounds of chaos and a pinch of salt Lines: 32 Message-ID: <33E7A163.321A@cs.com> References: <33E6C03F DOT 215F AT starnets DOT ro> Reply-To: fighteer AT cs DOT com NNTP-Posting-Host: ppp215.cs.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Korenschi Francisc Eduard wrote: > > Hello from Romania, > > What does the message "Return type for main changed to integer type" > mean ? > (I used the -Wall option) 'void', or any other type, is not a legal return type for main(). According to the ANSI standard, main() must always return an integer. In C, this isn't such a big issue for the compiler (it's still wrong!), but in C++, it's so important that the compiler will automatically convert the type to int if you don't specify it that way yourself. When you turn on all warnings, it mentions this. BTW, the issue of void main() is discussed at length in the comp.lang.c Frequently Asked Questions at http://www.eskimo.com/~scs/C-faq/top.html. Look at questions 11.12 through 11.16. The FAQ also gives complete ANSI references by section number. -- John M. Aldrich * Anything that happens, happens. * Anything that, in happening, causes something else to happen, causes something else to happen. * Anything that, in happening, causes itself to happen again, happens again. * It doesn't necessarily do it in chronological order, though. --- Douglas Adams