I'm using cppcheck on our code base and wondered about
newer versions.
I'm currently using 2.1 on Windows which works like previous
versions did (e.g. 1.85). I then tried 2.2. That still runs but
needs a multiple of time than 2.1. Whereas 2.1 needed a
few hours, version 2.2 hadn't finished in days, with the
same config (on the same machine, same resources etc).
It was still working, not dead, just a lot slower.
I then tried version 2.3, hoping that it had been fixed.
However this version ran just 10 configs (using -j 10)
and then finished, without an error. I don't know why
it stopped. So I'm back to 2.1.
I'm also seeing this warning in the beginning:
"cppcheck: unusedFunction check can't be used with '-j' option.
Disabling unusedFunction check."
But unusedFunction is already in my list of suppressions.
Shouldn't that disable it anyway?
Is any of this known? I'm not using misra or any other
plugin, just simple --enable=all --force and a few
suppressions, include paths etc.
spontanously I think that the analysis has increased for your code base so it's a good thing. But I am not sure.
If you want to investigate a bit you can try to run on some file with the command --showtime=summary. However you can't use -j then.
Is it C++ or C code? I think we check unused templates more in latest Cppcheck.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Do you mean that the times of --showtime=summary aren't useful if used together with -j? Because I'm already doing it now. But a run that needed about 11 hours was reported as 586625s which is over 6 days. I guess I can remove that switch for the normal run.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I made a test with checking one .cpp file of our base with 2.1 and 2.2. Concerning results, 2.2 found the same issues that 2.1 did and two additional knownConditionTrueFalse issues.
Other values are mostly the same or only slightly different. Does this mean that this increase in runtime is expected? Or is there a way to speed it up by disabling checks?
I can do the same with 2.3 to compare the results.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello
I'm using cppcheck on our code base and wondered about
newer versions.
I'm currently using 2.1 on Windows which works like previous
versions did (e.g. 1.85). I then tried 2.2. That still runs but
needs a multiple of time than 2.1. Whereas 2.1 needed a
few hours, version 2.2 hadn't finished in days, with the
same config (on the same machine, same resources etc).
It was still working, not dead, just a lot slower.
I then tried version 2.3, hoping that it had been fixed.
However this version ran just 10 configs (using -j 10)
and then finished, without an error. I don't know why
it stopped. So I'm back to 2.1.
I'm also seeing this warning in the beginning:
"cppcheck: unusedFunction check can't be used with '-j' option.
Disabling unusedFunction check."
But unusedFunction is already in my list of suppressions.
Shouldn't that disable it anyway?
Is any of this known? I'm not using misra or any other
plugin, just simple --enable=all --force and a few
suppressions, include paths etc.
Btw: I think you could save me hours of runtime by
fixing this here: https://trac.cppcheck.net/ticket/9832
Thanks a lot
bye Fabi
spontanously I think that the analysis has increased for your code base so it's a good thing. But I am not sure.
If you want to investigate a bit you can try to run on some file with the command
--showtime=summary
. However you can't use-j
then.Is it C++ or C code? I think we check unused templates more in latest Cppcheck.
yes that was a bug.. I have fixed that now.
Do you mean that the times of --showtime=summary aren't useful if used together with -j? Because I'm already doing it now. But a run that needed about 11 hours was reported as 586625s which is over 6 days. I guess I can remove that switch for the normal run.
hm.. I did not think you would get output at all. Well.. if you do get it then it's interesting. What are the top 5-6 items?
I don't know how useful those numbers are but here they are:
Tokenizer::simplifyTokens1: 287890s (avg. 2.40855s - 119528 result(s))
Tokenizer::tokenize::simplifyTemplates: 62847.5s (avg. 0.552831s - 113683 result(s))
Class::runChecks: 50961.3s (avg. 0.75599s - 67410 result(s))
Tokenizer::simplifyTokens1::ValueFlow: 39281.9s (avg. 0.346704s - 113301 result(s))
Tokenizer::tokenize::simplifyTypedef: 38793.5s (avg. 0.340234s - 114020 result(s))
Tokenizer::simplifyTokens1::createSymbolDatabase: 25886s (avg. 0.227352s - 113859 result(s))
Tokenizer::createTokens: 24631.5s (avg. 0.199518s - 123455 result(s))
All others were then below 10000s
I made a test with checking one .cpp file of our base with 2.1 and 2.2. Concerning results, 2.2 found the same issues that 2.1 did and two additional knownConditionTrueFalse issues.
Timewise 2.1 needed 1252s, 2.2 needed 3184s (reported statistics, not measured by myself).
Biggest differences:
2.1
Class::runChecks: 112.148s (avg. 0.752671s - 149 result(s))
Other::runChecks: 9.753s (avg. 0.0654564s - 149 result(s))
Type::runChecks: 5.069s (avg. 0.0340201s - 149 result(s))
String::runChecks: 1.136s (avg. 0.00762416s - 149 result(s))
2.2
Class::runChecks: 1841.87s (avg. 12.3615s - 149 result(s))
Other::runChecks: 58.061s (avg. 0.389671s - 149 result(s))
Type::runChecks: 49.593s (avg. 0.332839s - 149 result(s))
String::runChecks: 17.007s (avg. 0.114141s - 149 result(s))
Other values are mostly the same or only slightly different. Does this mean that this increase in runtime is expected? Or is there a way to speed it up by disabling checks?
I can do the same with 2.3 to compare the results.
2.3 finds the same issues as 2.2 but needs again more time:
2.3
Class::runChecks: 2867.73s (avg. 19.2465s - 149 result(s))
Other::runChecks: 89.245s (avg. 0.59896s - 149 result(s))
Type::runChecks: 77.126s (avg. 0.517624s - 149 result(s))
String::runChecks: 26.279s (avg. 0.176369s - 149 result(s))
Overall time: 5110.34s
And again: That's checking a single .cpp file, with one core of a Ryzen.
Unrelated note : the
showtime
option of cppcheck does not seem to be described in the manual or printed withcppcheck --help
.