I'm new to cppcheck so I may just be using it wrong, but using a build directory isn't saving any time for me - using both the GUI and command line. Even if I run the same command back to back without changing any files, it takes the same time (approximately 2 minutes for 190 files)
My command line looks like --cppcheck --cppcheck-build-dir=build-dir --project=project.sln "--project-configuration=RelWithDebInfo|x64" --enable=all -j8
Any thoughts?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What am I looking for exactly? About 80% of the files created in build-dir are .a1 and have their its own unique analyzerinfo hash number but are otherwise identical and look like:
<?xml version="1.0"?><analyzerinfohash="8543757348695670605"><errorid="preprocessorErrorDirective"severity="error"msg="failed to expand 'BOOST_MPL_AUX_NA_SPEC', Invalid ## usage when expanding 'BOOST_PP_TUPLE_ELEM_II': Unexpected token ')'"verbose="failed to expand 'BOOST_MPL_AUX_NA_SPEC', Invalid ## usage when expanding 'BOOST_PP_TUPLE_ELEM_II': Unexpected token ')'"><locationfile="C:\samepatheverytime\file.cpp"line="29"column="0"/></error></analyzerinfo>
There are also about 10% of .snanalyzerinfo files as well but it seems like they are only generated when their associated .a1 file included a FileInfo check error such as Uninitialized variables or CheckUnusedFunction
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You could dump the toolinfo string to a file (or look at it in the debugger) and compare the content from different runs to see if they are different. I remember an issue where suppressions changed randomly due to missing synchronization between threads.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hash numbers remain the same after each run - however they change depending on whether I run it via command line or the GUI. Another strange thing, if I use --enable=all then the files are not overwritten but I still don't get any improved speed
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm new to cppcheck so I may just be using it wrong, but using a build directory isn't saving any time for me - using both the GUI and command line. Even if I run the same command back to back without changing any files, it takes the same time (approximately 2 minutes for 190 files)
My command line looks like --cppcheck --cppcheck-build-dir=build-dir --project=project.sln "--project-configuration=RelWithDebInfo|x64" --enable=all -j8
Any thoughts?
Do the files in
build-dir
also change with every execution?Yes, they get completely refreshed.
The decision to run the analysis again happens here: https://github.com/danmar/cppcheck/blob/e17af6d2d865def4f3557bc374bd9892cd943709/lib/cppcheck.cpp#L749
Maybe you can look at the hashed strings?
What am I looking for exactly? About 80% of the files created in
build-dir
are .a1 and have their its own unique analyzerinfo hash number but are otherwise identical and look like:There are also about 10% of .snanalyzerinfo files as well but it seems like they are only generated when their associated .a1 file included a FileInfo check error such as Uninitialized variables or CheckUnusedFunction
You could dump the
toolinfo
string to a file (or look at it in the debugger) and compare the content from different runs to see if they are different. I remember an issue where suppressions changed randomly due to missing synchronization between threads.Hash numbers remain the same after each run - however they change depending on whether I run it via command line or the GUI. Another strange thing, if I use
--enable=all
then the files are not overwritten but I still don't get any improved speedWhat happens in this line? https://github.com/danmar/cppcheck/blob/e17af6d2d865def4f3557bc374bd9892cd943709/lib/cppcheck.cpp#L764
Is the analysis skipped when nothing has changed?
Are you on Windows?