Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use Compiler/Linker for C++ Code Clean-up

I'm using VS2008 for a C++ project. The code is quite old and has passed through many hands. There are several classes hierarchies, functions, enums and so on which are no longer being used.

Is there a way to get the compiler/linker to list out identifiers which have been declared or defined but are not being referred to anywhere?

like image 884
Agnel Kurian Avatar asked Oct 15 '08 06:10

Agnel Kurian


2 Answers

VS will warn about identifiers declared within a function and not used, you may need to move to warning level 4, but for global variables, and a hunt for many other potential problems, you would do well to try lint or visual lint

like image 136
David Sykes Avatar answered Oct 06 '22 02:10

David Sykes


PC-Lint "whole project" analysis (which analyses multiple files together) can do this. Please feel free to contact me if you need help setting it up.

like image 25
Anna-Jayne Metcalfe Avatar answered Oct 06 '22 01:10

Anna-Jayne Metcalfe