Manual; Add chapter about cppcheck build dir. Formatting tweaks.
This commit is contained in:
parent
e60d79e2c9
commit
21b1987b55
|
@ -24,9 +24,10 @@ The checks in Cppcheck are not perfect. There are bugs that should be found, tha
|
||||||
## About static analysis
|
## About static analysis
|
||||||
|
|
||||||
The kinds of bugs that you can find with static analysis are:
|
The kinds of bugs that you can find with static analysis are:
|
||||||
* undefined behavior
|
|
||||||
* using dangerous code patterns
|
- undefined behavior
|
||||||
* coding style
|
- using dangerous code patterns
|
||||||
|
- coding style
|
||||||
|
|
||||||
There are many bugs that you can not find with static analysis. Static analysis tools do not have human knowledge about
|
There are many bugs that you can not find with static analysis. Static analysis tools do not have human knowledge about
|
||||||
what your program is intended to do. If the output from your program is valid but unexpected then in most cases this is
|
what your program is intended to do. If the output from your program is valid but unexpected then in most cases this is
|
||||||
|
@ -34,10 +35,11 @@ not detected by static analysis tools. For instance, if your small program write
|
||||||
it is unlikely that any tool will complain about that.
|
it is unlikely that any tool will complain about that.
|
||||||
|
|
||||||
Static analysis should be used as a complement in your quality assurance. It does not replace any of;
|
Static analysis should be used as a complement in your quality assurance. It does not replace any of;
|
||||||
* careful design
|
|
||||||
* testing
|
- careful design
|
||||||
* dynamic analysis
|
- testing
|
||||||
* fuzzing
|
- dynamic analysis
|
||||||
|
- fuzzing
|
||||||
|
|
||||||
# Getting started
|
# Getting started
|
||||||
|
|
||||||
|
@ -405,6 +407,17 @@ The available options are:
|
||||||
- c++17: C++ code is C++17 compatible
|
- c++17: C++ code is C++17 compatible
|
||||||
- c++20: C++ code is C++20 compatible (default)
|
- c++20: C++ code is C++20 compatible (default)
|
||||||
|
|
||||||
|
# Cppcheck build dir
|
||||||
|
|
||||||
|
It's a good idea to use a Cppcheck build dir. On the command line use `--cppcheck-build-dir`. In
|
||||||
|
the GUI, the build dir is configured in the project options.
|
||||||
|
|
||||||
|
Rechecking code will be much faster. Cppcheck does not analyse unchanged code. The old warnings are
|
||||||
|
loaded from the build dir and reported again.
|
||||||
|
|
||||||
|
Whole program analysis does not work when multiple threads are used; unless you use a cppcheck
|
||||||
|
build dir. For instance, the unusedFunction warnings require whole program analysis.
|
||||||
|
|
||||||
# Suppressions
|
# Suppressions
|
||||||
|
|
||||||
If you want to filter out certain errors from being generated, then it is possible to suppress these.
|
If you want to filter out certain errors from being generated, then it is possible to suppress these.
|
||||||
|
|
Loading…
Reference in New Issue