On Wed, Oct 14, 2015 at 6:07 PM, Ehsan Akhgari <ehsan.akhg...@gmail.com> wrote:
> Last weekend, I finished upgrading our Linux and OS X debug and opt static > analysis builds ("S" jobs on TreeHerder) to the latest revision of clang > 3.7. > > Now, if you use the latest version of clang (3.7, which is available from < > http://llvm.org/releases/download.html#3.7.0> in binary form), you can > turn > on static analysis checks locally by adding the following line to your > mozconfig: > > ac_add_options --enable-clang-plugin > > Doing this helps you in detecting errors specific to the "S" jobs early > during development, which simplifies the process of landing patches by > letting you see the errors at the same time as other compiler errors. > > On Linux, most other recent versions of clang should work too, such as the > one you usually get from your distro, provided that the dev package for > LLVM/Clang has been installed. On OSX, the default clang that ships with > recent versions of XCode lacks the dev headers and tools so it can't be > used, but the llvm.org clang binaries should work well. > > I have been running this plugin locally in all of my builds for several > months now and once you migrate to this setup, everything should proceed > hassle free. If you find issues getting your particular clang setup to > work with the plugin, please let me know, and I will help fix them. I'd > like to eventually get us to a point where these checks are turned on by > default during local builds. > As you stated, this helps detect errors earlier during development, which is a huge win. Is there a good reason configure doesn't enable the clang plugin by default? If the plugin adds too much overhead, could we potentially factor out the expensive checks so developers aren't burdened by them by default? _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform