Must main return a value?

Doug Gwyn gwyn at smoke.brl.mil
Sat Jun 29 05:34:01 AEST 1991


In article <7830001 at hpwrce.HP.COM> walterm at hpwrce.HP.COM (Walter Murray) writes:
>Many people have written that the main function must return a value.
>I can't find such a requirement in the Standard.  I have read 2.1.2.2.3
>and 3.6.6.4.  Am I missing something?

You must be -- 2.1.2.2.3 states explicitly "If the main function executes a
return that specifies no value, the termination status returned to the host
environment is undefined."  That meets the condition for causing undefined
behavior on at least two counts.



More information about the Comp.std.c mailing list