how has C bitten you?

Roy Smith roy at phri.UUCP
Sat Aug 10 09:15:20 AEST 1985


	Here's one that just got me:

		if (sv > score);   <----- note extraneous semi-colon
			score = sv;

	This was in a series of computations which gave various scores; the
fragment above was repeated in various places to pick out the maximum.  Of
course, the test is a no-op and the assignment was always done.  Naturally,
this passes lint (even with the -h flag which uses "heuristic tests to
attempt to intuit bugs") without any complaint.
-- 
Roy Smith <allegra!phri!roy>
System Administrator, Public Health Research Institute
455 First Avenue, New York, NY 10016



More information about the Comp.lang.c mailing list