[comp.lang.c] Lint doesn't complain about null actions in "if" statements

bob@omni.com (Bob Weissman) (07/06/89)

In article <1989Jul4.042350.11064@twwells.com>, bill@twwells.com (T. William Wells) writes:
> In article <11038@ihlpl.ATT.COM> knudsen@ihlpl.ATT.COM (Knudsen) writes:
> : Yes, but suppose you make the same typo and get
> :       if ( condition ); {     /* extra semicolon */
> :               action;
> :       }
> : Isn't this still legal C (with the same bug), since compound blocks
> 
> It avoids the bug because, if you always use braces, putting a
> semicolon in that place is just not one of the typos you'll do.
> Consider the hand movement necessary to do that and you'll see
> what I mean.

Well, often these errors are generated not as typos, but as the result
of brain cell failure while editing.

Since I started this discussion, I may as well admit that my code originally
looked like

	assert(condition);

Then I decided that I really wanted to do somthing else in this case and
changed it to

	if (negation of condition);
	    action;

Just stupid. Dumb. Truly Bad Editing.

-- 
Bob Weissman
Domainish: bob@omni.com
UUCPish:   ...!{amdahl,apple,pyramid,tekbspa,uunet}!koosh!bob