clang-tidy vs. Xcode Static Analyzer

Does anyone know the relationship, if any, between Xcode's static analyzer and clang-tidy?

I.e. is Xcode's Analyze feature actually invoking a built-in clang-tidy?

If not, does anyone have any experience using upstream clang-tidy (homebrew?) with a mostly-Xcode development flow?

Replies

The relationship is exceedingly remote. clang-tidy is a shallow ‘clang-based C++ linter tool ’, whereas the Clang Static Analyzer, which Xcode uses under the hood, is a fairly deep symbolic execution tool. Xcode integrates the static analyzer in its user interface, though you can also analyze from the command line. If you’re serious about this, see also deep commercial C/++ static analysis tools such as Klocwork and Coverity, which find much more profound bugs, but have a cumbersome web-based user interface. (See “Deploying Static Analysis.”)

It is possible to mix the configuration of clang-tidy and static analysis, but I’ve never done this.