If I define an unused function like this, it's properly detected as unused by cppcheck:
namespace abc {
void iAmNotUsed() {
}
}
But if I define it like this, it's not detected:
void abc::iAmNotUsed() {
}
In both cases the function is declared in a header file inside the "abc" namespace. Both are equivalent, so IMO both should work. I'm trying to use cppcheck to detect unused functions in our large code base, but I can't do it because of this problem. Thank you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
If I define an unused function like this, it's properly detected as unused by cppcheck:
But if I define it like this, it's not detected:
In both cases the function is declared in a header file inside the "abc" namespace. Both are equivalent, so IMO both should work. I'm trying to use cppcheck to detect unused functions in our large code base, but I can't do it because of this problem. Thank you.
Are you providing
namespace abc
somehow?gives:
Are you setting the include paths properly?
Indeed, I didn't set the include path. Thank you!