To: djgpp AT delorie DOT com Subject: Re: A program to find all unused symbols in a C program Message-ID: <19970227.181936.4687.1.chambersb@juno.com> References: <34DB2D72539 AT fs2 DOT mt DOT umist DOT ac DOT uk> <5f3oan$6ol AT flex DOT uunet DOT pipex DOT com> <3315BD67 DOT 75C229F9 AT alcyone DOT com> From: chambersb AT juno DOT com (Benjamin D Chambers) Date: Thu, 27 Feb 1997 21:16:29 EST On Thu, 27 Feb 1997 08:59:19 -0800 Erik Max Francis writes: >nikki wrote: > >> just a thought, but putting 'static' before global variables and >> compiling >> with -Wall will show unusued global variables too. as well as local >> unused >> ones. > >Those are static external, not external (e.g., global). The static >qualifier before a variable definitions outside of any block means >that the >linkage is internal to that file. You can't reference it in another >file. > >In other words, it's _not_ global across files if you do this. Isn't that what's wanted? When you try to link, you'll get an error saying that the link whatever can't be found - now you KNOW that that variable was accessed (else it wouldn't generate an error). ...Chambers