I'd like to use scan-build. The official site says there are pre-built binaries for it, but fails to provide any links to them: https://clang-analyzer.llvm.org/installation

How do I install clang-analyzer?

2 Answers 2


From the main page:

The analyzer is 100% open source and is part of the Clang project. Like the rest of Clang, the analyzer is implemented as a C++ library that can be used by other tools and applications.

Emphasis mine

Download the Clang project and the analyzer will be included.

  • This doesn't explicitly answer my question. I suppose you're saying that if I have clang then I'll have clang-analyzer. Howerver which clang shows clang in /usr/bin/clang. which scan-build comes up empty. Is there another package I need?
    – firebush
    Commented Oct 29, 2020 at 18:31
  • If it's not there, then you should direct your inquiry to the people who actually manage it. There's a Clang Developers Mailing List posted on the Obtaining the Static Analyzer Page
    – Allan
    Commented Oct 29, 2020 at 18:35
  • Your answer at least puts me in the right direction. That official clang-analyzer official installation link I referenced is simply out of date (there aren't separate binary packages for it) and clang itself should be updated and installed. Thanks for the information.
    – firebush
    Commented Oct 29, 2020 at 18:38
  • Glad I could help! :-)
    – Allan
    Commented Oct 29, 2020 at 18:39

The easiest way to install is to get HomeBrew installed (https://brew.sh if needed), and then have it grab llvm :

brew install llvm

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .