blob: dd79d0fc2254edf94e31bb10ac53711fd4afcd20 [file] [log] [blame] [view]
andybons222c4ee2015-08-25 16:51:031# The Clang Static Analyzer
andybons3322f762015-08-24 21:37:092
andybons222c4ee2015-08-25 16:51:033See the [official clang static analyzer page](http://clang-analyzer.llvm.org/)
4for background.
andybons3322f762015-08-24 21:37:095
kmarshall520f9512017-01-24 23:25:016As of early 2017, we have experimental support for the Clang static analysis
7tool in the Chrome build. Warnings generated by the analysis tool are logged
8to stderr along with other compiler errors at build time.
andybons222c4ee2015-08-25 16:51:039
kmarshall520f9512017-01-24 23:25:0110To enable static analysis for your build, add the following line to your
11output directory's `args.gn`:
andybons3322f762015-08-24 21:37:0912
13```
kmarshall520f9512017-01-24 23:25:0114use_clang_static_analyzer = true
andybons3322f762015-08-24 21:37:0915```
16
kmarshall520f9512017-01-24 23:25:0117The next time you rebuild, you should see static analysis warnings appear inline
18with the usual Clang build warnings and errors.
andybons3322f762015-08-24 21:37:0919
kmarshall520f9512017-01-24 23:25:0120## Future plans/potential issues
21* Support for running under GOMA is untested, but will be added shortly if
22 feasible.