We want to help developers like you. Tell us about how you work: http://qsurvey.mozilla.com/s3/Developer-Audience-Survey-V2/?s=mdn

この記事はまだボランティアによって 日本語 に翻訳されていません。ぜひ MDN に参加して翻訳を手伝ってください!

Note: This documentation describes features which are only available in the mozilla-central code repository.  They are not present any released version of Firefox.

In addition to the normal errors and warnings provided by C++ compiler, there are often code patterns in Mozilla which are legal C++ but are nevertheless incorrect in various ways. Mozilla can now use a tool called Dehydra GCC to detect incorrect code and provide authors with instant feedback during the compile process.

Using Static Checking

Follow these steps to use static checking:

  • Build GCC with plugin support (see instructions on the Dehydra GCC page)
  • Build Dehydra GCC
  • Add the following line to your .mozconfig file:
ac_add_options --with-static-checking=/path/to/gcc_treehydra.so

As each C++ file in Mozilla is built, g++ will pass compilation information to config/static-checking.js. This script will perform Mozilla-specific code checking.

To change the analyses that are run, edit config/static-checking-config.mk.


The following macros are currently used to annotate classes:

The following macros are currently used to annotate methods:


 このページの貢献者: amccreight, jdm, DavidBolter, SergeG, Tglek, BenjaminSmedberg, Sheppy, Vlad.sukhoy
 最終更新者: amccreight,