/knight

kight is a static analysis tool for c/c++ programs.

Primary LanguageC++MIT LicenseMIT

logo

Knight

LanguageLicenseUbuntu BuildMacOS BuildWin Build

Knight is a static analysis tool for C/C++ programs written in C++20.

Install

knight dependencies

  • cmake
  • llvm/clang(>=18 is best)
  • GMP (>= 6 is best)

You can install llvm by your package manager

apt install llvm libgmp-dev libedit-dev # for Ubuntu
brew install llvm gmp # for Homebrew
yum install llvm gmp-devel libedit-devel # for CentOS
sudo pacman -S llvm gmp # for Arch Linux

or build from source.

Install knight by following steps

cd knight
chmod +x scripts/install
# scripts/install --help
scripts/install

or run step by step:

cd knight
cmake -DLLVM_BUILD_DIR=/path/to/llvm/build -B path-to-build -S .
cmake --build path-to-build -j$(nproc)
path-to-build/bin/knight --help # for usages

Note: Knight only support C++20, so you need to use a cpp compiler support C++20.

Test

Use scripts/unittest to run all unit tests.

Troubleshooting

See TROUBLESHOOTING.md for more details.

Contributing

Contributions are welcome, See CONTRIBUTING.md for more details

Licence

Knight is MIT-licensed, see LICENSE for more details