lint enhancement for 4.?bsd (and others?)

Arthur David Olson ado at elsie.UUCP
Sun Sep 23 05:09:36 AEST 1984


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)



More information about the Comp.unix.wizards mailing list