questions from using lint

KW Heuer kwh at bentley.UUCP
Fri May 16 13:43:01 AEST 1986


In article <640 at bunkerb.UUCP> bunkerb!garys (Gary Samuelson) writes:
>In article <797 at bentley.UUCP> kwh at bentley.UUCP (KW Heuer) writes:
>>(It's too bad lint can't tell whether you've tested the return value of
>>open(), etc.)
>
>??? Lint certainly can check for that (at least the lint I use); it says
>something like "open returns value which is sometimes ignored"

By "open(), etc." I meant the class a functions which return a useful value
even when they succeed.  For example, lint does *not* catch the following:
	fp = fopen(fname, "r");
	c = getc(fp);
which is a potential error because fopen() could return NULL.  Trouble is,
even if lint knew that fopen had such an error return, it would have to
know whether getc() is prepared to handle it (it isn't).

Karl W. Z. Heuer (ihnp4!bentley!kwh), The Walking Lint



More information about the Comp.lang.c mailing list