C Compiler bug

Arthur David Olson ado at elsie.UUCP
Sun Jul 27 08:58:11 AEST 1986


For those with source code, here's an addition to "lint" to generate warnings
about
	float /= int
and
	int /= float
constructs.  This is an addition to the 4.1BSD version of "lint/lint.c",
in particular to the function "clocal"; your mileage will vary.
As always, the trade secret status of the code involved precludes a clearer
posting.  The addition is conditioned on "OLDVERSION".

	...
	NODE *
	clocal(p) NODE *p; {
	...
		switch( o = p->in.op ){
	#ifndef OLDVERSION
		case ASG MUL:
			if (pflag && p->in.right->in.op == SCONV)
				werror( "mixed-mode *= may surprise you");
			break;
		case ASG DIV:
			if (pflag && p->in.right->in.op == SCONV)
				werror( "mixed-mode /= may surprise you");
			break;
	#endif /* !OLDVERSION */
	...
--
Lint is an Oscar Madison trademark.
--
	UUCP: ..decvax!seismo!elsie!ado   ARPA: elsie!ado at seismo.ARPA
	DEC, VAX, Elsie & Ado are Digital, Borden & Ampex trademarks.



More information about the Comp.lang.c mailing list