For some time we've had a moz.build option called FAIL_ON_WARNINGS. If you
build with --enable-warnings-as-errors (as the test machines do) the presence
of FAIL_ON_WARNINGS in a directory's moz.build files causes compiler warnings
from that directory's files to be treated as errors. I.e. it enables -Werror
(for gcc and clang) and -WX (for MSVC).

The FAIL_ON_WARNINGS coverage has gradually increased over time, thanks to the
efforts of many people, to the point where many more directories have it than
lack it. Therefore it makes sense to change it from an opt-in option to an
opt-out one.

I just landed the patches in bug 1198334 that do exactly that. The option has
also changed name and is now called ALLOW_COMPILER_WARNINGS. (If you're
wondering why I changed the name, it's because it's easier in mozbuild to have
an option that defaults to False than to True.)

The patches remove 455 occurrences of FAIL_ON_WARNINGS from moz.build files,
and add 79 instances of ALLOW_COMPILER_WARNINGS.

- About half of those 79 are in third-party code that we do not control (i.e.
  we regularly update from upstream), for which the option will always be
  necessary. There may also be some third-party directories in which I didn't
  add ALLOW_COMPILER_WARNINGS because it wasn't currently necessary, but where
  it may become necessary if future updates introduce new warnings.

- The other half are in code that we do control (some of which is third-party
  code that we have forked and so now control, e.g. ipc/chromium/). These
  should be fixable without too much effort. If you are interested in doing
  this, please search for (a) occurrences of ALLOW_COMPILER_WARNINGS that are
  preceded by a "XXX: We should fix these warnings." comment, and (b)
  conditional (and thus indented) occurrences of ALLOW_COMPILER_WARNINGS, i.e.
  those that are enabled only for certain compilers or platforms.

In other warnings-related news, in bug 1198124 cpeterson recently turned on
-Wshadow in moz.build files for directories that have no shadowing warnings.
This is currently only 36 moz.build files because there is shadowing occurring
in some widely-used header files. It should be possible to increase coverage
with some effort. See https://bugzilla.mozilla.org/show_bug.cgi?id=1198124#c6
for more details.

Nick
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to