www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/17/13:09:29

Date: Wed, 17 Jun 1998 13:09:02 -0400 (EDT)
Message-Id: <199806171709.NAA26180@delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: wagray AT taz DOT dra DOT hmg DOT gb
CC: djgpp AT delorie DOT com
In-reply-to: <6m8ru9$qcl$2@trog.dra.hmg.gb> (wagray@taz.dra.hmg.gb)
Subject: Re: Help! Why is my program crashing?

>  :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.

- Raw text -


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