Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tienntr/8de8d8ff370d512aad5d4776884ade23 to your computer and use it in GitHub Desktop.
Save tienntr/8de8d8ff370d512aad5d4776884ade23 to your computer and use it in GitHub Desktop.
Newer Clang/LLVM on CentOS7
cd /etc/pki/rpm-gpg
curl -O http://springdale.princeton.edu/data/springdale/7/x86_64/os/RPM-GPG-KEY-springdale
cd /etc/yum.repos.d
cat << EOF > Springdale-SCL.repo
[Springdale-SCL]
name=Springdale - SCL
baseurl=http://springdale.princeton.edu/data/springdale/SCL/$releasever/$basearch
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-springdale
EOF
yum install llvm-toolset-13.0 llvm-toolset-13.0-clang-analyzer llvm-toolset-13.0-clang-tools-extra
# Static analysis with Z3
printf "void f(){}" | clang -xc - -o - --analyze -Xclang -analyzer-constraints=z3
# Z3 refutation, require Z3 (see above)
clang -cc1 -analyzer-config-help | grep crosscheck-with-z3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment