Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 beta 3/9/83; site cwruecmp.UUCP Path: utzoo!watmath!clyde!floyd!whuxle!mit-eddie!genrad!decvax!cwruecmp!decot From: decot@cwruecmp.UUCP (Dave Decot) Newsgroups: net.lang.c,net.bugs.4bsd Subject: lint bug: f((int) double expr) Message-ID: <1090@cwruecmp.UUCP> Date: Sun, 11-Mar-84 03:31:01 EST Article-I.D.: cwruecmp.1090 Posted: Sun Mar 11 03:31:01 1984 Date-Received: Tue, 13-Mar-84 08:30:26 EST Organization: CWRU Computer Engr. Cleveland, Ohio Lines: 33 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