CLANG-CHECK(1)
β¨ NAME β¨
okay so this is the manual page for clang-check β bestie, it's literally the clang-check 13 era. π
πΈ DESCRIPTION πΈ
USAGE, babes:
clang-check [options] <source0> [... <sourceN>]
OPTIONS: π
π Generic Options π
--helpβ shows you all the available options (and if you want even more, there's--help-hidden)--help-listβ prints a whole list of the available options (and yep,--help-list-hiddenexists for the extra ones too)--versionβ tells you the version of this program, iconic
π¦ clang-check options π¦
--analyzeβ runs the static analysis engine π₯--ast-dumpβ builds the ASTs and then debug-dumps them--ast-dump-filter=<string>β use this with-ast-dumpor-ast-printto only dump/print AST declaration nodes that have a certain substring in their qualified name. Use-ast-listto list all the filterable declaration node names π--ast-listβ builds ASTs and prints the list of declaration node qualified names--ast-printβ builds ASTs and then pretty-prints them β¨--extra-arg=<string>β an extra argument that gets appended to the compiler command line--extra-arg-before=<string>β an extra argument that gets prepended to the compiler command line--fix-what-you-canβ applies fix-it advice even when there are unfixable errors present (fix what you can, periodt)--fixitβ applies fix-it advice to the input source-p=<string>β build path--syntax-tree-dumpβ dumps the syntax tree--tokens-dumpβ dumps the preprocessed tokens
-p <build-path> is what you use to read a compile command database. ποΈ
For example, it can totally be a CMake build directory that has a file named compile_commands.json living in it (use the -DCMAKE_EXPORT_COMPILE_COMMANDS=ON CMake option to get that output, bestie). If you don't specify a build path, it'll go hunting for compile_commands.json through every parent path 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. π«Ά
<source0> ... these are where you specify the paths of your source files. The paths get looked up in the compile command database. If a file's path is absolute, it needs to point into CMake's source tree. If the path is relative, then the current working directory needs to be inside the CMake source tree, and the file has to be in a subdirectory of the current working directory. Any "./" prefixes in relative files get automatically removed, but the rest of a relative path has to be a suffix of a path in the compile command database. no cap. π
For example, to run clang-check on every file in a subtree of the source tree, use:
find path/in/subtree -name '*.cpp'|xargs clang-check
or if you wanna use a specific build path:
find path/in/subtree -name '*.cpp'|xargs clang-check -p build/path
Note, that path/in/subtree and the current directory should follow the rules described above. β
and that's the whole vibe, bestie π this was clang-check 13, dated July 2023, and yeah β main character manpage energy, we ate and left no crumbs ππ
π¦ where this page comes from
- ubuntu jammy: clang-tools-13 1:13.0.1-2ubuntu2.2 Β· APACHE-2-LLVM-EXCEPTIONS
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms