prototype my function, please

Karl Heuer karl at haddock.ima.isc.com
Mon Jun 11 06:42:12 AEST 1990


In article <246 at taumet.com> steve at taumet.UUCP (Stephen Clamage) writes:
>[Given `int main(void) { ... exit(0); }'] It seems some compilers [would
>complain if a `return' were added], and some about absence of return [on an
>int function].  What to do?  What to do?

My opinion: leave it out, and if the compiler doesn't provide a way to
suppress the warning, then complain to the vendor.  Since it is very common to
leave main() with exit(), and since this is a defensible programming style,
the compiler should allow it--even if it has to make main() a special case.

Karl W. Z. Heuer (karl at ima.ima.isc.com or harvard!ima!karl), The Walking Lint



More information about the Comp.lang.c mailing list