Mail Archives: djgpp/1998/06/19/01:45:55
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 -