Defect Report #085
Submission Date: 03 Dec 93
Source: Clive Feather
Item 22 - returning from main
Consider the following program:
void handler (void)
printf ("Value is %d\n", *pi);
int main (void)
i = 42;
pi = &i;
Return from main is defined to be equivalent to calling exit
(subclause 126.96.36.199.3). If the return statement was replaced
by the equivalent call, the program would be strictly conforming.
Is it strictly conforming without this replacement?
Note that if the answer is ``yes,'' special processing will
be required for return from main, which will depend on whether
the call being returned from is the initial call or a recursive one.
In subclause 188.8.131.52.3, page 7,
add at the end of the first sentence the footnote:
In accordance with subclause 184.108.40.206,
objects with automatic storage duration declared
in main will no longer have storage guaranteed to be reserved
in the former case even where they would in the latter.
Previous Defect Report
< - >
Next Defect Report