I developed new C project and I use some time variables to debug or to check value ...
I want to be sure if I don't forget any unused variable after achieving project.
there is a Linux utilities or command to do that ?
I developed new C project and I use some time variables to debug or to check value ...
I want to be sure if I don't forget any unused variable after achieving project.
there is a Linux utilities or command to do that ?
Some compilers can issue a warning for you when an automatic variable is unused. Try
gcc -Wunused-variable
clang -Wunused-variable
I would do such things with preprocessor statements.
For example, you could define: #define DEBUG
and in code
#ifdef DEBUG
//debug code in here
#endif
When compiling the final code, just don't define DEBUG
I recommend you use cppcheck, it comes in ubuntu repositories or you can download and compile the code from:
It's an awesome tool of static code analysis that will tell you some of the code errors you can make.