[net.bugs.4bsd] lint bug: f

decot@cwruecmp.UUCP (Dave Decot) (03/11/84)

Description:
    Lint (actually, probably pcc) incorrectly decides that the type of many
    double expressions cast to int and used as parameters is still double.

Repeat-by:
    running lint(1) with no flags on the following:

	main() {
	    foo((int) 1.0);
	}

	foo(x)
	int x;
	{
	     printf("%d\n", x);
	}
    
    yields

	foo, arg. 1 used inconsistently	tst.c(7)  ::  tst.c(2)

Fix:
    % cd /usr/src
    Permission denied.

Hints:
    Double expressions cast to int are allowed to be added to pointers.

    Changing the type of the formal parameter to double suppresses
    the message, as does replacing the 1.0 with a declared and initialized
    float or double variable.

Dave Decot	 decvax!cwruecmp!decot