We'd like to use cppcheck in our firm, but we have a big codebase, so we can't rely on multithreading(takes at least one day with it), but rather on splitting jobs to serveral linux machines our cluster, with a shared file system.
If we'd give up on whole program analysis, we can just send a job of the style: send-jobs-to-cluster array=[files...] cppcheck $0 ...
And then merge the output and get the analysis.
However, if we want to have a whole program analysis, we cannot use this trick.
There were a similar problem when using mutithreading (by -j), but it is fixable by using a build dir that cppcheck could read from in the whole program analyze step. However, it seems that there is no analog solution for my cluster splitting case.
I believe it would be OK to provide some options to "compile" and "link" results. Making it possible to perform distributed analysis sounds very interesting to me. Keeping the "distributed analysis engine" out of Cppcheck is also a good idea :-)
Not sure what the options would be for cppcheck to "only compile" and "only link". Does anybody have suggestions? "--ctu-info" to "compile" and "--check-ctu=<ctu-info.txt>" to "link" provided ctu-info ??</ctu-info.txt>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
We'd like to use cppcheck in our firm, but we have a big codebase, so we can't rely on multithreading(takes at least one day with it), but rather on splitting jobs to serveral linux machines our cluster, with a shared file system.
If we'd give up on whole program analysis, we can just send a job of the style:
send-jobs-to-cluster array=[files...] cppcheck $0 ...
And then merge the output and get the analysis.
However, if we want to have a whole program analysis, we cannot use this trick.
There were a similar problem when using mutithreading (by
-j
), but it is fixable by using a build dir that cppcheck could read from in the whole program analyze step. However, it seems that there is no analog solution for my cluster splitting case.I believe that the solution to that is very simple, and I'd like this tool designers to say their opinion: Split the code of https://github.com/danmar/cppcheck/blob/337dfc954a97b44414f75a7e66ec247955ff9251/cli/cppcheckexecutor.cpp#L250-L320 to two steps - before whole program analysis and after, and allow the user (by cli parameters?) to specify if he wants the "before" or "after".
This solution is analogous of course to the steps of compiling and then linking.
I believe it would be OK to provide some options to "compile" and "link" results. Making it possible to perform distributed analysis sounds very interesting to me. Keeping the "distributed analysis engine" out of Cppcheck is also a good idea :-)
Not sure what the options would be for cppcheck to "only compile" and "only link". Does anybody have suggestions? "--ctu-info" to "compile" and "--check-ctu=<ctu-info.txt>" to "link" provided ctu-info ??</ctu-info.txt>
That's overall sounds great. Notice that clang static analyzer have similar semantics on CLI.
I thought that "--check-ctu" can point to the "%.snalyzerinfo" files generated in the build dir.
I have created this ticket:
https://trac.cppcheck.net/ticket/12840
If anybody would be interested to fix this feel free to provide a github PR. :-)