lint [but not really printf]

Fred Fish fnf at estinc.UUCP
Sat Jul 15 04:48:20 AEST 1989


In article <LIMES.89Jul12153110 at ouroborous.wseng.sun.com> limes at sun.com (Greg Limes) writes:
>
>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

I can honestly say that I have NEVER been bitten by this sort of bug in
my own C code, because my style rules dictate that it be written as:

	if (condition) {
		action;
	}

and it would never occur to my fingers to stick a ';' in place of the
'{'.  Just because the {} are optional is no reason to leave them out.

If you are going to leave them out, at least have the decency to
write it as:

	if (condition) action;

(Sorry about the obvious, but this is my pet peeve #1 about other
 people's code...)

-Fred
-- 
# Fred Fish, 1835 E. Belmont Drive, Tempe, AZ 85284,  USA
# 1-602-491-0048           asuvax!{nud,mcdphx}!estinc!fnf



More information about the Comp.lang.c mailing list