lint [but not really printf]

Greg Limes limes at sun.com
Thu Jul 13 08:31:10 AEST 1989


In article <105 at borabora.omni.com> bob at omni.com (Bob Weissman) writes:
   Last week I spent an entire day tracking down one of those bugs you just
   don't see after staring at your code too long.  It was of the form:

	   if (condition);
	       action;

You mean this never bit you before? Put it in your list of common
things to look for when the bugs get weird, along with confusing the
assignment and equality test operations. watch even for the
combinations; I kid you not, I once saw this:

	if (fp = (struct file *)0);
		perror("opening file");

Yes, C is sometimes difficult to debug. 

Oh, you want an easy way to find those extra semicolons, and
mismatched comment delimiters? Run the code through "indent", or
something like it. If the indentation does not match what you think
the code should be doing, look again carefully ...
--
Greg Limes	limes at sun.com	...!sun!limes	73327,2473	[chose one]



More information about the Comp.lang.c mailing list