Tried to search eClipse help for enabling this feature but no luck...I want my code to be clean by removing all "unused variables"
By default, the compiler does warn about unused local or static global variables. This can be disabled with the -pds179 option; make sure you are not using that option. The compiler cannot detect unused non-static global variables. Could you post source code that demonstrates the problem?
As Archaeologist said it's set by default, you can check if it's set going to:
Window -> Preferences -> C/C++ -> Code Analysis -> Potential Programming Problems -> Unused variable declaration in file scope
Regards
Thanks guys,
Option #179 is selected and works fine in detecting unused "Local" variables, but no option for detecting unused "global" variables!?
There is no option for detecting unused non-static globals. Knowing whether the global is truly unused would require looking at every source file in the entire application, and the part of the compiler that does the detection can only see the one source file.