Use Clang static analyzer Install scan-build and configure your project. Then do this: $ ninja scan-build You can use the SCAN_BUILD environment variable to choose the scan-build executable. $ SCAN_BUILD=<your exe> ninja scan-build