Skip to content

Commit db4e737

Browse files
committed
README.md: re-wrote "Known Issues" section
1 parent bcdb117 commit db4e737

File tree

2 files changed

+50
-7
lines changed

2 files changed

+50
-7
lines changed

README.md

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,59 @@ See
3636

3737
## Known Issues
3838

39+
### Analyzing header files
40+
3941
`cppcheck` is not designed to be run on header files (`.h`) directly, as must be done for this
4042
plugin, and as a result may have false positives.
4143

4244
When run on header files directly, `cppcheck` defaults to C as the language, which will generate
43-
false positives for C++ projects. C++ projects should append `--language=c++` to the
44-
`cppcheck` options.
45+
false positives for C++ projects. So `--language=c++` is implicitly added as option when analyzing header files.
46+
47+
It will also provide `unusedFunction` and `unusedStructMember` false positives so these findings are being suppressed.
48+
49+
### Analyzing multiple configurations
50+
51+
By default `cppcheck` tries to determine all the available configurations for a file (i.e. all combination of the used
52+
preprocessor defines). As the plugin doesn't get the current list of defines this may lead to findings shown in code
53+
which is shown as disabled in the editor. To check just a specific configuration you can either add defines using `-D`
54+
to the options. Or you can limit the configurations to a single one adding `--max-configs=1`.
55+
56+
By default Limiting the configurations also decreases the time of the analysis.
57+
58+
By default a maximum of 12 configurations is checked. This may lead to some code which might actually be active not to
59+
show any findings. This can also be controlled by the `--max-configs=<n>` option.
60+
61+
### Multiple include paths
62+
63+
No additional includes path are being passed to `cppcheck` for the analysis which might result in false positives or not
64+
all findings being shown.
65+
66+
You can add additional include path using the `-I <path>` options.
67+
68+
### Batch analysis
69+
70+
The batch analysis passes the files individually to `cppcheck` just like the highlighting inspections. So if you pass a
71+
folder to the batch analysis it might not show the same findings as when passing a folder to `cppcheck` itself.
72+
73+
It will also pass all the contents of the folder to the analysis and not just project files. This might lead to
74+
unexpected findings.
75+
76+
Also some findings in headers files triggered by the analysis of a source files are not being shown.
77+
78+
### Showing raw output
79+
80+
Currently there is no way to view the raw output of the `cppcheck` execution.
81+
82+
### External libraries / System includes
83+
84+
`cppcheck` does not support analyzing of external library or system includes. It provides profiles for several external
85+
libraries which describe the contents and behavior of the includes which allows it to finding issues with usage of them
86+
in the code. To add such a profile to your analysis you need to specify it via the `--library=<name>` option. The
87+
available profile can be found in the `cfg` folder of your `cppcheck` installation.
88+
89+
### Global options
90+
91+
Currently the configured options are global and not per project.
4592

4693
## Development
4794

resources/META-INF/plugin.xml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,7 @@
5252
<br/>
5353
5454
<b>Known issues:</b><br/>
55-
Cppcheck is not designed to be run on header files (.h) directly, as must be done for this
56-
plugin, and as a result may have false positives.<br/>
57-
When run on header files directly, Cppcheck defaults to C as the language, which will
58-
generate false positives for C++ projects. C++ projects should leave --language=c++ appended to the
59-
Cppcheck options.<br/>
55+
Please refer to <a href="https://github.com/johnthagen/clion-cppcheck#known-issues">Known Issues</a>.<br/>
6056
]]></description>
6157

6258
<change-notes><![CDATA[

0 commit comments

Comments
 (0)