bug in lint (really - oldfashioned =op)

Bill Stewart wcs at ho95b.UUCP
Thu Feb 21 14:10:32 AEST 1985


	> As of System V, all the old syntax (initializers without "=", the "=+",
	> "=-", "=*", etc. operators) has, indeed, disappeared.  Anybody out there
	> with a S5 compiler care to try some of the guys that cause earlier PCCs to
	> drop core?
	> 
	> 	Guy Harris
	> 	{seismo,ihnp4,allegra}!rlgvax!guy

Unfortunately, the old =- is still with us in System V, sort of:
	main(){
		int j;
		j=5;
		j=-1;
		}
Under System V, both lint and cc complain that the j=-1 line is
ambiguous, and select the assignment-op.  Then they reject it, and
don't produce object code.

Under System V Rel 2, it finally lets you say j=-1; when you mean
	j = (-1);
- the lint comment is that the assignment is ambiguous, but the
unary-op is chosen, so it does it right this time.

			Bill Stewart 
P.S. I didn't remember the old init syntax, so I haven't tried it.
-- 
			Bill Stewart
			AT&T Bell Labs, Holmdel NJ 1-201-949-0705
			...!ihnp4!ho95b!wcs



More information about the Comp.bugs.4bsd.ucb-fixes mailing list