cli: publish the --clang option

This commit is contained in:
Daniel Marjamäki 2020-05-08 20:52:42 +02:00
parent e329169ce5
commit 32cbbb09ed
2 changed files with 9 additions and 0 deletions

View File

@ -973,6 +973,7 @@ void CmdLineParser::printHelp()
" analysis is disabled by this flag.\n" " analysis is disabled by this flag.\n"
" --check-library Show information messages when library files have\n" " --check-library Show information messages when library files have\n"
" incomplete info.\n" " incomplete info.\n"
" --clang Import Clang AST\n"
" --config-exclude=<dir>\n" " --config-exclude=<dir>\n"
" Path (prefix) to be excluded from configuration\n" " Path (prefix) to be excluded from configuration\n"
" checking. Preprocessor configurations defined in\n" " checking. Preprocessor configurations defined in\n"

View File

@ -108,6 +108,14 @@ This option is only valid when supplying an input directory. To ignore multiple
cppcheck -isrc/b -isrc/c cppcheck -isrc/b -isrc/c
### Clang parser
By default Cppcheck uses an internal C/C++ parser. However it is possible to use the Clang parser instead.
Install `clang`. Then use Cppcheck option `--clang`.
Technically, Cppcheck will execute `clang` with its `-ast-dump` option. The Clang output is then imported and converted into our normal Cppcheck format. And then normal Cppcheck analysis is performed on that.
## Severities ## Severities
The possible severities for messages are: The possible severities for messages are: