Playing With Static Analyzers

LLVM/Clang’s static analyzer

You can run the static analyzer over your codebase using scan-build.

Infer

Facebook’s static analyzer for C, C++, objective-C and Java. Written in OCaml.

It supports projects that use build systems like make, Cmake, Gradle, etc…

Testing

They both generate nice reports in html that you can easily browse.

They don’t necessarily catch the same problems, so it’s definitely useful to use both.

Bugs found running them on a few random codebases

RetroArch

Toybox

VLC


91 Words

2020-01-03