Re: warnings, errors;source code is included
- From: James Henstridge <james daa com au>
- To: David Benson <daveb idealab com>
- cc: * * <msg124 hotmail com>, gnome-devel-list gnome org, recipient list not shown: ;
- Subject: Re: warnings, errors;source code is included
- Date: Mon, 15 Nov 1999 09:49:56 +0800 (WST)
Of course, since he used exit(0) at the end of main, we never get to the
end of main (exit does not return control to the calling function). So it
would not matter what the return type of main was. Yes it is true that
you should use "int main(...".
James.
--
Email: james@daa.com.au
WWW: http://www.daa.com.au/~james/
On Sun, 14 Nov 1999, David Benson wrote:
> Though `void main()' suppresses the compiler warnings,
> the calling function will assume main's exit status
> is to be the exit status for the process.
>
> In other words, if you want to reliably exit and indicate
> that the run was successful, you should declare `int main()'
> and return 0 if you are exitting successfully.
>
> Of course, in many gui environments, exit codes are
> just ignored... but you shouldn't assume that...
>
> - Dave
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]