Strange lint mumblings

Liber nevin1 at ihlpb.ATT.COM
Wed Dec 28 10:35:14 AEST 1988


In article <11274 at haddock.ima.isc.com> karl at haddock.ima.isc.com (Karl Heuer) writes:
>(b)  According to the dpANS, the type of `main' must be either `int(void)' or
>`int(int, char **)'.  A `void' declaration, although logically correct, cannot
>be used in a strictly conforming program.

It is only logically correct when exit() is "reachable" from all possible
executions of main().  It may not be logically correct if someone
recursively calls main() and expects a return value.  What value main()
returns and if main() calls some funky function so that it never
returns are two different issues.
-- 
NEVIN ":-)" LIBER  AT&T Bell Laboratories  nevin1 at ihlpb.ATT.COM  (312) 979-4751



More information about the Comp.lang.c mailing list