Must main return a value?

Doug Gwyn gwyn at smoke.brl.mil
Sat Jun 29 15:17:05 AEST 1991


In article <1991Jun29.002410.27632 at aero.org> lmiller at aero.org (Lawrence H. Miller) writes:
>The question one might ask of a standards body is why this is "undefined"
>and not "implementation defined," since it clearly involves the program's
>interaction with its host.

I don't think you understand what these terms mean as used in the C
standard.  Either that, or you really believe that an implementation
could document what would happen for every program that returned
garbage instead of a deliberate value, where the garbage is NOT
specified in the program (unlike the case for the part of 4.10.4.3
that you quoted).

Basically, this was specified to cause undefined behavior because
that's exactly what it does.



More information about the Comp.std.c mailing list