delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/19/01:45:55

From: wagray AT taz DOT dra DOT hmg DOT gb (Walter Gray)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Help! Why is my program crashing?
Date: 18 Jun 1998 15:35:57 GMT
Organization: Defence Research Agency
Message-ID: <6mbc4t$5l4$5@trog.dra.hmg.gb>
References: <199806171709 DOT NAA26180 AT delorie DOT com>
Reply-To: wagray AT taz DOT dra DOT hmg DOT gb
NNTP-Posting-Host: taz.dra.hmg.gb
Lines: 26
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In article <199806171709 DOT NAA26180 AT delorie DOT com>, DJ Delorie <dj AT delorie DOT com> writes:
 :
 :>  :Note also that `main' must return `int'.
 :>
 :> Why is that important?  If I just ignore the warning and carry on
 :> using void am I going to have problems? Or is it just one of those 
 :> "C things"?
 :
 :Your program will always return *something*.  If you don't do it
 :yourself, whatever garbage happens to be in that spot will get used by
 :default.  Since many other djgpp programs check this code ("make" is
 :one very important example), it's important that you make sure it
 :returns something reasonable.
 :
 :For example, if you called your program in a Makefile and it returned
 :some non-zero garbage, make would stop at that point, thinking it was
 :an error.


Are we talking about the exit(something) value, or is this another
return mechanism entirely?


Walter

Disclaimer: My employer is not responsible for this stuff.

- Raw text -


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