Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/17/84; site elsie.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!mhuxj!houxm!vax135!cornell!uw-beaver!tektronix!hplabs!hao!seismo!umcp-cs!cvl!elsie!ado
From: ado@elsie.UUCP (Arthur David Olson)
Newsgroups: net.unix-wizards
Subject: lint enhancement for 4.?bsd (and others?)
Message-ID: <1260@elsie.UUCP>
Date: Sat, 22-Sep-84 15:09:36 EDT
Article-I.D.: elsie.1260
Posted: Sat Sep 22 15:09:36 1984
Date-Received: Wed, 26-Sep-84 07:08:35 EDT
Organization: NIH-LEC, Bethesda, MD
Lines: 30

Had a program today that looked (in part) like this:

	control(counter)
	int	counter;
	{
		if (control > 0)
			--counter;
	}

I was surprised that lint failed to pick up the typo.  So for all you folks
with "lint.c" source:

> ed lint.c
> /case LE:/a
> #ifndef OLDVERSION
>		if (p->in.left->in.op == ICON && p->in.right->in.op == ICON)
>			werror("comparison of constants");
>		else if (p->in.op != EQ && p->in.op != NE)
>			if (ISPTR(p->in.left->in.type) &&
>			    ISFTN(DECREF(p->in.left->in.type)) ||
>			    ISPTR(p->in.right->in.type) &&
>			    ISFTN(DECREF(p->in.right->in.type))	)
>				werror("function address in comparison");
> #endif
.
w
q
--
	...decvax!seismo!umcp-cs!elsie!ado	(301) 496-5688
	(DEC, VAX and Elsie are Digital Equipment Corp. and Borden's trademarks)