Knight is a static analysis tool for C/C++ programs written in C++20.
- 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
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.
Use scripts/unittest
to run all unit tests.
See TROUBLESHOOTING.md for more details.
Contributions are welcome, See CONTRIBUTING.md for more details
Knight is MIT-licensed, see LICENSE for more details