Clang Static Analyzer | Enabling Diagnostics that Cross File Boundaries

Hello everyone,

Could anyone please guide me on how to enable diagnostics that cross file boundaries while using scan-build?

Thank you.



The clang static analyzer doesn’t support analysis between translation units (for example when a path crosses from one .c file into another .c file).

The analyzer does support when a path crosses from a .c to a .h (this is technically cross file) — but the scan-build tool cannot visualize those diagnostics in html. Other tools (such as Xcode) can visualize paths between a .c and header files.

In event, I suspect you are looking for true cross-translation unit analysis — which the analyzer does not support.

There is some very preliminary investigation of cross-translation unit support in if you are interested!


The scan-build's cross-file diagnostic support is being currently worked on in