|
36 | 36 |
|
37 | 37 | ## Known Issues
|
38 | 38 |
|
| 39 | +### Analyzing header files |
| 40 | + |
39 | 41 | `cppcheck` is not designed to be run on header files (`.h`) directly, as must be done for this
|
40 | 42 | plugin, and as a result may have false positives.
|
41 | 43 |
|
42 | 44 | 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. |
45 | 92 |
|
46 | 93 | ## Development
|
47 | 94 |
|
|
0 commit comments