C code and locating unused structure elements
C question: I can use the compiler to find unused variables declared in functions, and unused parameters to functions. I want to see if I can locate potentially not used members of structures. I realize this is more difficult. But is there any tool out there (perhaps bundled with SUSE 10.x) that may help? At least, for a directory of code, report items not used by code in that directory. -- Roger Oberholtzer OPQ Systems AB Ramböll Sverige AB Kapellgränd 7 P.O. Box 4205 SE-102 65 Stockholm, Sweden Tel: Int +46 8-615 60 20 Fax: Int +46 8-31 42 23
On Tue, 17 Oct 2006 13:11:12 +0200
Roger Oberholtzer
C question:
I can use the compiler to find unused variables declared in functions, and unused parameters to functions.
I want to see if I can locate potentially not used members of structures. I realize this is more difficult. But is there any tool out there (perhaps bundled with SUSE 10.x) that may help? At least, for a directory of code, report items not used by code in that directory. I am not aware of any tool that does this, or ever did. However, if you dump the symbol table with cxref(1) you have the information you need. -- Jerry Feldman
Boston Linux and Unix user group http://www.blu.org PGP key id:C5061EA9 PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
On Sat, 2006-10-21 at 11:31 -0400, Jerry Feldman wrote:
On Tue, 17 Oct 2006 13:11:12 +0200 Roger Oberholtzer
wrote: C question:
I can use the compiler to find unused variables declared in functions, and unused parameters to functions.
I want to see if I can locate potentially not used members of structures. I realize this is more difficult. But is there any tool out there (perhaps bundled with SUSE 10.x) that may help? At least, for a directory of code, report items not used by code in that directory. I am not aware of any tool that does this, or ever did. However, if you dump the symbol table with cxref(1) you have the information you need.
Thanks for the pointer. I will have a look. -- Roger Oberholtzer
On Sun, 22 Oct 2006 12:35:49 +0200
Roger Oberholtzer
Thanks for the pointer. I will have a look. Originally, I was going to point to Purify Plus, but even Purify does not give you that info. One thing Purify does is to track every byte of memory that the program has whether or not it is used or not.
--
Jerry Feldman
participants (2)
-
Jerry Feldman
-
Roger Oberholtzer