Hi I have a project where several function are wrongly marked as unused. For instance in source/a/b/x.cpp
InputMetrics CalculateInputMetrics(const InputData& ds) { // some code }
then in another file source/a/y.cpp
void LogInputDataMetrics(const InputData& input_data) { auto metric = f(CalculateInputMetrics(input_data)); // do stuff }
CalculateInputMetrics is flagged as unused.
CalculateInputMetrics
Sorry for late reply. hmm.. I don't get this false positive:
$ ~/.cppcheck/cppcheck-2.12.0 --enable=all a.cpp b.cpp Checking a.cpp ... 1/2 files checked 35% done Checking b.cpp ... 2/2 files checked 100% done b.cpp:1:0: style: The function 'LogInputDataMetrics' is never used. [unusedFunction] void LogInputDataMetrics(const InputData& input_data) { ^
do you use some similar cppcheck options?
Log in to post a comment.
Hi I have a project where several function are wrongly marked as unused. For instance in source/a/b/x.cpp
then in another file source/a/y.cpp
CalculateInputMetrics
is flagged as unused.Sorry for late reply. hmm.. I don't get this false positive:
do you use some similar cppcheck options?