I have not got that feature request before. There is no builtin functionality right now.
I assume you want to stop because a full analysis takes too much time? Do you use --cppcheck-build-dir to make the analysis quicker?
Technically it would be possible to add some command line flag. But well I try to be a bit restrictive about it. As far as I know there is only 1 user that wants this currently.
It is possible for you to achieve this anyway without a flag. Check 1 file at a time from a script and terminate when the exit code is non-zero.
Last edit: Daniel Marjamäki 2018-01-04
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In the folder "jonyre" cppcheck will store analyzer info.
The first time you execute cppcheck, you will not see any big difference.
The second time you execute cppcheck, the analysis should go much faster. Because this time only changed files are re-analyzed. If no files are changed the analysis should quit in a few seconds. You still get the full report.
Please note you need to use the same command line flags when you execute cppcheck the second time, otherwise cppcheck will not reuse the analyzer info in the jonyre folder.
Last edit: Daniel Marjamäki 2018-01-04
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I haven't edited the project file in a while, it seems to have some stuff I hadn't noticed. I went to add some excluded directories for third party results I ignore, but I'm seeing two instances where Cppcheck returns error level results for two different header files in MinGW's include directory even though I have added that directory as an excluded path in the project. Did I do it wrong or is this a bug/limitation with Cppcheck?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I use cppcheck to look for errors.
now I'm looking for a way the stop the cppcheck run after he found the first error.
didnt found any in the manual.
Thanks for your help.
I have not got that feature request before. There is no builtin functionality right now.
I assume you want to stop because a full analysis takes too much time? Do you use --cppcheck-build-dir to make the analysis quicker?
Technically it would be possible to add some command line flag. But well I try to be a bit restrictive about it. As far as I know there is only 1 user that wants this currently.
It is possible for you to achieve this anyway without a flag. Check 1 file at a time from a script and terminate when the exit code is non-zero.
Last edit: Daniel Marjamäki 2018-01-04
Thanks.
I think ill make a script.
can you explain/link this "--cppcheck-build-dir" ?
The build dir is a folder with arbitrary name.. Example:
mkdir jonyre
cppcheck --cppcheck-build-dir=jonyre --enable=style path
cppcheck --cppcheck-build-dir=jonyre --enable=style path
In the folder "jonyre" cppcheck will store analyzer info.
The first time you execute cppcheck, you will not see any big difference.
The second time you execute cppcheck, the analysis should go much faster. Because this time only changed files are re-analyzed. If no files are changed the analysis should quit in a few seconds. You still get the full report.
Please note you need to use the same command line flags when you execute cppcheck the second time, otherwise cppcheck will not reuse the analyzer info in the jonyre folder.
Last edit: Daniel Marjamäki 2018-01-04
thanks !
That's interesting. Is there a way to store it in the GUI program's project file or will it just be for command line?
sure. It is configured in the project dialog.
I haven't edited the project file in a while, it seems to have some stuff I hadn't noticed. I went to add some excluded directories for third party results I ignore, but I'm seeing two instances where Cppcheck returns error level results for two different header files in MinGW's include directory even though I have added that directory as an excluded path in the project. Did I do it wrong or is this a bug/limitation with Cppcheck?