.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.2. .TH CLANG-CHECK "1" "May 2022" "clang-check 12" "User Commands" .SH NAME clang-check \- manual page for clang-check 12 .SH DESCRIPTION USAGE: clang\-check [options] [... ] .PP OPTIONS: .PP Generic Options: .HP \fB\-\-help\fR \- Display available options (\fB\-\-help\-hidden\fR for more) .HP \fB\-\-help\-list\fR \- Display list of available options (\fB\-\-help\-list\-hidden\fR for more) .HP \fB\-\-version\fR \- Display the version of this program .PP clang\-check options: .HP \fB\-\-analyze\fR \- Run static analysis engine .HP \fB\-\-ast\-dump\fR \- Build ASTs and then debug dump them .HP \fB\-\-ast\-dump\-filter=\fR \- Use with \fB\-ast\-dump\fR or \fB\-ast\-print\fR to dump/print only AST declaration nodes having a certain substring in a qualified name. Use \fB\-ast\-list\fR to list all filterable declaration node names. .HP \fB\-\-ast\-list\fR \- Build ASTs and print the list of declaration node qualified names .HP \fB\-\-ast\-print\fR \- Build ASTs and then pretty\-print them .HP \fB\-\-extra\-arg=\fR \- Additional argument to append to the compiler command line .HP \fB\-\-extra\-arg\-before=\fR \- Additional argument to prepend to the compiler command line .HP \fB\-\-fix\-what\-you\-can\fR \- Apply fix\-it advice even in the presence of unfixable errors .HP \fB\-\-fixit\fR \- Apply fix\-it advice to the input source .HP \fB\-p=\fR \- Build path .PP \fB\-p\fR is used to read a compile command database. .IP For example, it can be a CMake build directory in which a file named compile_commands.json exists (use \fB\-DCMAKE_EXPORT_COMPILE_COMMANDS\fR=\fI\,ON\/\fR CMake option to get this output). When no build path is specified, a search for compile_commands.json will be attempted through all parent paths of the first input file . See: https://clang.llvm.org/docs/HowToSetupToolingForLLVM.html for an example of setting up Clang Tooling on a source tree. .PP ... specify the paths of source files. These paths are .IP looked up in the compile command database. If the path of a file is absolute, it needs to point into CMake's source tree. If the path is relative, the current working directory needs to be in the CMake source tree and the file must be in a subdirectory of the current working directory. "./" prefixes in the relative files will be automatically removed, but the rest of a relative path must be a suffix of a path in the compile command database. .IP For example, to run clang\-check on all files in a subtree of the source tree, use: .IP find path/in/subtree \fB\-name\fR '*.cpp'|xargs clang\-check .IP or using a specific build path: .IP find path/in/subtree \fB\-name\fR '*.cpp'|xargs clang\-check \fB\-p\fR build/path .IP Note, that path/in/subtree and current directory should follow the rules described above.