A
Army1987
Flash said:Richard Bos wrote, On 11/07/07 15:21: [...]Of course, it should by now be apparent that MAO is that both i=i++ and
void main() are illegal C, though each may be legal C-plus-extensions.
I agree with you here, and agree with what I think is your main point,
that void main() should simply be considered illegal and it left at that.
Well, 5.1.2.2.1 specifically states that, in addition to the two
defined prototypes of main:
int main(void)
and
int main(int argc, char *argv[])
you are allowed:
some other implementation-defined manner
So? An implementation might define whatever it wants, as long as
it doesn't break strictly conforming programs. For example,
fopen() with implementation-defined modes other than "r", "w", "b"
and version of these with '+' and/or 'b', implementation-defined
conversion specifiers with printf(), MS's behavior of
fflush(stdin)...
"Undefined behavior" doesn't imply "an implementation is forbidden
from defining and/or documenting a behavior". So the case of
void main() is not different from that of fopen(name, "rx"), and
neither from that of i = i++, even if I sorted them in decreasing
likelihood to be defined to something intentionally useful (but
that's OT in comp.lang.c, which only deals with standard C).