This question is in continuation to http://stackoverflow.com/questions/979129/. It would be great if there is some tool that would allow to remove the hanging code (code not being used). Examples would be unused variables,references,functions or even class (old code or code only written for experimentation).
A:
Good linkers will remove unused code from an executable. It is an optimization option. This likely will not work for public functions on shared libraries, but internal code will get trimmed if there are no ways into it.
Check your linker though(or maybe compiler-- depending on language).
Kekoa
2009-06-11 03:42:49
Oops I realize you are probably talking about the source code, not machine code.
Kekoa
2009-06-11 03:44:11
A:
Certain versions of Visual Studio 2008 (development edition for sure) have a code analysis tool that can help.
Cody C
2009-06-11 03:43:48
A:
Klocwork had some capabilities to point out legacy code hanging around.
Also, GCC has warnings that can be enabled that will catch a lot of trivial things like unused varaibles or static functions.
Chris Arguin
2009-06-11 05:40:03