Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!oliveb!apple!rutgers!att!westmark!mole-end!mat From: mat@mole-end.UUCP (Mark A Terribile) Newsgroups: comp.lang.c Subject: Re: Why does lint complain about this? Summary: Lint and args Message-ID: <150@mole-end.UUCP> Date: 26 Apr 89 23:38:06 GMT References: <75688@ti-csl.csc.ti.com> Organization: mole-end--private system. admin: mole-end!newtnews Lines: 32 In article <75688@ti-csl.csc.ti.com>, ramey@m2.csc.ti.com (Joe Ramey) writes: > try(0); > ... > try(foo) > char *foo; > { > trylint.c: > trylint.c(7): warning: argument foo unused in function try > try, arg. 1 used inconsistently trylint.c(8) :: trylint.c(3) > Why does lint say that the arg. is used inconsistently? I thought > that zero could be assigned to any pointer type. ... The problem is that the compiler (or LINT) doesn't know that what must actually be passed is a char* . Thus, the compiler could pass a 16-bit zero to a routine expecting a 32-bit pointer. This is why function prototypes (ANSI C, C++) are better than LINT. (Oh, do I expect a debate on that last statement!) You should write try( (char *) 0 ); in your sample code. -- (This man's opinions are his own.) From mole-end Mark Terribile