Re: Is main a registered word
- From: Random832 <random@xxxxxxxxxxxxx>
- Date: 8 Dec 2006 16:46:38 GMT
2006-12-08 <1165594037.776960.120100@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
santosh wrote:
Keith Thompson wrote:
Simias <fvzvnf.a@xxxxxxxxx> writes:
Thad Smith <ThadSmith@xxxxxxx> writes:
mark_bluemel@xxxxxxxxx wrote:
In C99, executing to the closing brace of main is the equivalent of
return 0.
Even if it's a recursive call to main?
I think so.
C99 5.1.2.2.3 says:
If the return type of the main function is a type compatible with
int, a return from the initial call to the main function is
equivalent to calling the exit function with the value returned by
the main function as its argument; reaching the } that terminates
the main function returns a value of 0.
The way it's phrased, I think the last clause refers to any call to
main, not just the initial call.
It seems to contradict the preceding statement. Anyhow, what if the
code returns a value other than zero, say EXIT_FAILURE?
Execution paths that reach a return statement will not reach the } that
terminates the function.
.
- References:
- Is main a registered word
- From: small TUX
- Re: Is main a registered word
- From: mark_bluemel
- Re: Is main a registered word
- From: Thad Smith
- Re: Is main a registered word
- From: Simias
- Re: Is main a registered word
- From: Keith Thompson
- Re: Is main a registered word
- From: santosh
- Is main a registered word
- Prev by Date: Re: Print without using any inbuilt function?
- Next by Date: From file to char* array
- Previous by thread: Re: Is main a registered word
- Next by thread: Re: Is main a registered word
- Index(es):
Relevant Pages
|