Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!columbia!rutgers!ames!amdcad!amd!intelca!mipos3!omepd!intelisc!littlei!ogcvax!pase From: pase@ogcvax.UUCP (Douglas M. Pase) Newsgroups: comp.lang.c,comp.bugs.4bsd Subject: lint bug fix needed Message-ID: <1367@ogcvax.UUCP> Date: Thu, 30-Jul-87 20:19:56 EDT Article-I.D.: ogcvax.1367 Posted: Thu Jul 30 20:19:56 1987 Date-Received: Sat, 8-Aug-87 02:03:26 EDT Reply-To: pase@ogcvax.UUCP (Douglas M. Pase) Organization: Oregon Graduate Center, Beaverton, OR Lines: 90 Xref: mnetor comp.lang.c:3482 comp.bugs.4bsd:478 I have been having a problem with lint, and I would like to know if there is a "fix" for it. The problem, briefly, is that lint fails to notice that the argument to the function bis_empty (line 21) is of a different type than its formal parameter (line 26). However, if any one of lines 3, 4, 8, 9, 10, or 11 are deleted, it does recognize the inconsistency as it should. I have included a script file which illustrates what I discribe. `lint1.c' shows the bug, `lint2.c' shows the correct behavior. Please send me your responses via e-mail as I don't usually follow either of these groups - (...ucbvax!tektronix!ogcvax!pase or pase@Oregon-Grad.csnet) Script started on Thu Jul 30 16:31:30 1987 [101] num lint1.c 1 struct s_bstack { 2 int top; 3 int limit; 4 long block[1]; 5 }; 6 7 struct s_symtab { 8 short node; 9 short task; 10 short offset; 11 struct s_predicate *p; 12 }; 13 14 struct s_strategy { 15 struct s_symtab symlist[16]; 16 }; 17 18 bind_unif_mgu(eval) 19 struct s_strategy *eval; 20 { 21 if (! bis_empty(eval->symlist)) 22 ; 23 } 24 25 bis_empty(stack) 26 struct s_bstack *stack; 27 { 28 return(stack->top <= 0); 29 } [102] lint lint1.c lint1.c: bind_unif_mgu defined( lint1.c(20) ), but never used [103] num lint2.c 1 struct s_bstack { 2 int top; 3 int limit; 4 }; 5 6 struct s_symtab { 7 short node; 8 short task; 9 short offset; 10 struct s_predicate *p; 11 }; 12 13 struct s_strategy { 14 struct s_symtab symlist[16]; 15 }; 16 17 bind_unif_mgu(eval) 18 struct s_strategy *eval; 19 { 20 if (! bis_empty(eval->symlist)) 21 ; 22 } 23 24 bis_empty(stack) 25 struct s_bstack *stack; 26 { 27 return(stack->top <= 0); 28 } [104] lint lint2.c lint2.c: bis_empty, arg. 1 used inconsistently lint2.c(26) :: lint2.c(20) bind_unif_mgu defined( lint2.c(19) ), but never used [105] diff lint1.c lint2.c 4d3 < long block[1]; [106] exit [107] script done on Thu Jul 30 16:33:58 1987 Thank you for any help you can give me. -- Doug Pase -- ...ucbvax!tektronix!ogcvax!pase or pase@Oregon-Grad.csnet