L
Lawrence Kirby
C89 requires a return; C99 doesn't. Almost everyone posting has a C89
compiler; almost no one posting here has a C99 compiler. Doesn't it
make sense to require the return? Consider that there was no good
reason for the C99 standardization committee to allow this one exception
to the rule that functions that return values do so explicitly. The
inexcusable reason is that too many bad programmers had been writing
code in violation of the standard for the last 10 years.
C89 doesn't require a return. If you fall off the end of main() you get an
undefined termination status but not an invalid program. If the
program doesn't fall off the end of main() there's no problem at all.
However an undefined termination status is undesirable in normal
circumstances so falling off the end of main() is considered a bad thing,
hence the initial point above.
Lawrence