Message-Id: <199702282149.QAA16603@delorie.com> From: MTEEL DOT DTECHS AT dtechs DOT com (Mark Teel) Date: Fri, 28 Feb 1997 15:45 EST To: owner-djgpp-list AT delorie DOT com Cc: djgpp AT delorie DOT com Subject: fwd: Re: A program to find all unused symbols in a C program ======== Original Message ======== 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 ======== Fwd by: Mark Teel ======== Boy, listening to this conversation is scary. You guys need to concentrate more on your design principles (such as data encapsulation) and ease up on the global variables in general. They are bad for your health! MST