Date: Mon, 28 Nov 94 18:27:28 -0500 From: dj AT stealth DOT ctron DOT com (DJ Delorie) To: A DOT APPLEYARD AT fs1 DOT mt DOT umist DOT ac DOT uk Cc: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Re: Unused variables > In djgpp, how can I get a list of all variables and labels in a program > which are declared but not used? I was editing a program which someone wants > me to make it more efficient, and in the process many variables became > redundant, and I want to find them by some means quicker than having to search > for every one with my emacs's search-for-word. Compile with the -Wall switch. This will take care of most local and static variables. As for globals, you have to "nm" the object files looking for references to them - it's not automatic.