Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 beta 3/9/83; site vaxine.UUCP Path: utzoo!linus!vaxine!jwf From: jwf@vaxine.UUCP (Jim Franklin) Newsgroups: net.lang.c Subject: lint() and #include files Message-ID: <313@vaxine.UUCP> Date: Tue, 10-Jul-84 17:58:16 EDT Article-I.D.: vaxine.313 Posted: Tue Jul 10 17:58:16 1984 Date-Received: Thu, 12-Jul-84 00:40:31 EDT Organization: Automatix Inc., Billerica, MA Lines: 31 Is lint supposed to understand lexical scope? I have two files "foo.c" and "foo.h", where "foo.h" declares local variables for "foo.c": ----- file foo.h: ---------------------------------------------- static int abc; ----- file foo.c: ---------------------------------------------- #include "foo.h" main () { printf ("%d\n", abc); } ---------------------------------------------------------------- If I run lint (BSD 4.2) on foo.c I get what I consider to be bogus error messages: > lint foo.c foo.c: abc defined( ./foo.h(1) ), but never used abc used( foo.c(5) ), but not defined If I make variable "abc" be external by removing the keyword static then lint is happy. Is this a bug or a feature? I know that I can use the -u switch to make this message go away, but why should I have to?