Listing Unused Variables
-
HI, Does anyone know of any free tools or Visual Studio add-in that will check the source files in a project for unused variables and/or functions? :thumbsup: Tony
-
HI, Does anyone know of any free tools or Visual Studio add-in that will check the source files in a project for unused variables and/or functions? :thumbsup: Tony
Set the compiler warning level to 4.
Watched code never compiles.
-
HI, Does anyone know of any free tools or Visual Studio add-in that will check the source files in a project for unused variables and/or functions? :thumbsup: Tony
-
can't you compile with warning Level 4 in Project->Properties->C/C++->General->Warning Level -> Level 4 (/W4) ?
Thanks for the reply. Yea, I have used warning level 4 to identify any unused local variables but I was thinking of something on a bigger scale i.e. something that would identify class members and methods which are not referenced in the project. Of couse I could right click every method in the class view and show where it is called but that could drive a man insane! Thanks again for the reply. :thumbsup: :thumbsup:
-
Set the compiler warning level to 4.
Watched code never compiles.
AFAIK that works well for local variables, but not for class level variables or methods. :)
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
-
HI, Does anyone know of any free tools or Visual Studio add-in that will check the source files in a project for unused variables and/or functions? :thumbsup: Tony
Check Doxygen. It has been very long since I used it, but it may help dig out something. I know there is something with unused function, but not sure for unused variables. I could be way off the mark, it has been very long since I used it.
Yusuf May I help you?
-
AFAIK that works well for local variables, but not for class level variables or methods. :)
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
I still don't understand why people write unused code!! :rolleyes:
Watched code never compiles.
-
I still don't understand why people write unused code!! :rolleyes:
Watched code never compiles.
Don't blame the programmers. Blame the users, they tend to avoid those pieces of an app that contain most of the bugs. :)
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.