Skip to content

Commit

Permalink
Bug 1198334 (part 1) - Replace the opt-in FAIL_ON_WARNINGS with the o…
Browse files Browse the repository at this point in the history
…pt-out ALLOW_COMPILER_WARNINGS. r=glandium.

The patch removes 455 occurrences of FAIL_ON_WARNINGS from moz.build files, and
adds 78 instances of ALLOW_COMPILER_WARNINGS. About half of those 78 are in
code we control and which should be removable with a little effort.

--HG--
extra : rebase_source : 82e3387abfbd5f1471e953961d301d3d97ed2973
  • Loading branch information
nnethercote committed Aug 28, 2015
1 parent 4e53819 commit f442870
Show file tree
Hide file tree
Showing 539 changed files with 239 additions and 939 deletions.
2 changes: 0 additions & 2 deletions accessible/atk/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,3 @@ include('/ipc/chromium/chromium-config.mozbuild')
if CONFIG['CLANG_CXX']:
# Suppress clang warning about unused function from gobject's RTTI macros.
CXXFLAGS += ['-Wno-unused-function']

FAIL_ON_WARNINGS = True
2 changes: 0 additions & 2 deletions accessible/base/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,3 @@ if CONFIG['MOZ_ENABLE_GTK']:
CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']

include('/ipc/chromium/chromium-config.mozbuild')

FAIL_ON_WARNINGS = True
2 changes: 0 additions & 2 deletions accessible/generic/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,3 @@ else:
FINAL_LIBRARY = 'xul'

include('/ipc/chromium/chromium-config.mozbuild')

FAIL_ON_WARNINGS = True
2 changes: 0 additions & 2 deletions accessible/html/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,3 @@ else:
]

FINAL_LIBRARY = 'xul'

FAIL_ON_WARNINGS = True
2 changes: 0 additions & 2 deletions accessible/ipc/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,3 @@ if CONFIG['ACCESSIBILITY']:
FINAL_LIBRARY = 'xul'

include('/ipc/chromium/chromium-config.mozbuild')

FAIL_ON_WARNINGS = True
2 changes: 0 additions & 2 deletions accessible/mac/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,3 @@ LOCAL_INCLUDES += [
FINAL_LIBRARY = 'xul'

include('/ipc/chromium/chromium-config.mozbuild')

FAIL_ON_WARNINGS = True
2 changes: 0 additions & 2 deletions accessible/other/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,3 @@ LOCAL_INCLUDES += [
]

FINAL_LIBRARY = 'xul'

FAIL_ON_WARNINGS = True
2 changes: 0 additions & 2 deletions accessible/windows/ia2/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,4 @@ FINAL_LIBRARY = 'xul'
if CONFIG['GNU_CXX']:
CXXFLAGS += ['-Wshadow']

FAIL_ON_WARNINGS = True

include('/ipc/chromium/chromium-config.mozbuild')
2 changes: 0 additions & 2 deletions accessible/windows/msaa/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,3 @@ FINAL_LIBRARY = 'xul'

if CONFIG['GNU_CXX']:
CXXFLAGS += ['-Wshadow']

FAIL_ON_WARNINGS = True
2 changes: 0 additions & 2 deletions accessible/windows/sdn/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,3 @@ FINAL_LIBRARY = 'xul'

if CONFIG['GNU_CXX']:
CXXFLAGS += ['-Wshadow']

FAIL_ON_WARNINGS = True
2 changes: 0 additions & 2 deletions accessible/windows/uia/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,3 @@ LOCAL_INCLUDES += [
]

FINAL_LIBRARY = 'xul'

FAIL_ON_WARNINGS = True
4 changes: 2 additions & 2 deletions accessible/xpcom/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ else:

FINAL_LIBRARY = 'xul'

if CONFIG['GNU_CXX']:
FAIL_ON_WARNINGS = True
if not CONFIG['GNU_CXX']:
ALLOW_COMPILER_WARNINGS = True
2 changes: 0 additions & 2 deletions accessible/xul/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,3 @@ else:
]

FINAL_LIBRARY = 'xul'

FAIL_ON_WARNINGS = True
2 changes: 0 additions & 2 deletions b2g/app/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ if CONFIG['OS_ARCH'] == 'WINNT':
if CONFIG['GNU_CXX']:
CXXFLAGS += ['-Wshadow']

FAIL_ON_WARNINGS = True

JS_PREFERENCE_FILES += [
'b2g.js',
]
Expand Down
2 changes: 1 addition & 1 deletion b2g/config/mozconfigs/linux32_gecko/debug
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export MOZILLA_OFFICIAL=1

export MOZ_TELEMETRY_REPORTING=1

# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors

# Use sccache
Expand Down
2 changes: 1 addition & 1 deletion b2g/config/mozconfigs/linux32_gecko/nightly
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export MOZILLA_OFFICIAL=1

export MOZ_TELEMETRY_REPORTING=1

# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors

# Use sccache
Expand Down
2 changes: 1 addition & 1 deletion b2g/config/mozconfigs/linux64_gecko/debug
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export MOZILLA_OFFICIAL=1

export MOZ_TELEMETRY_REPORTING=1

# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors

# Use sccache
Expand Down
2 changes: 1 addition & 1 deletion b2g/config/mozconfigs/linux64_gecko/nightly
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export MOZILLA_OFFICIAL=1

export MOZ_TELEMETRY_REPORTING=1

# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors

# Use sccache
Expand Down
2 changes: 1 addition & 1 deletion b2g/config/mozconfigs/macosx64_gecko/debug
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export MOZ_TELEMETRY_REPORTING=1

#ac_add_options --with-macbundlename-prefix=Firefox

# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors

# B2G Stuff
Expand Down
2 changes: 1 addition & 1 deletion b2g/config/mozconfigs/macosx64_gecko/nightly
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export MOZ_TELEMETRY_REPORTING=1

#ac_add_options --with-macbundlename-prefix=Firefox

# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors

# B2G Stuff
Expand Down
2 changes: 1 addition & 1 deletion b2g/dev/config/mozconfigs/macosx64/mulet
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export MOZILLA_OFFICIAL=1

ac_add_options --with-macbundlename-prefix=Firefox

# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors

# Package js shell.
Expand Down
2 changes: 0 additions & 2 deletions b2g/gaia/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,3 @@ if not CONFIG['MOZ_B2GDROID']:
]
DEFINES['B2G_NAME'] = '"%s-bin%s"' % (PROGRAM, CONFIG['BIN_SUFFIX'])
DEFINES['GAIA_PATH'] = '"gaia/profile"'

FAIL_ON_WARNINGS = True
2 changes: 0 additions & 2 deletions browser/app/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,3 @@ JAR_MANIFESTS += ['jar.mn']

if CONFIG['GNU_CXX']:
CXXFLAGS += ['-Wshadow']

FAIL_ON_WARNINGS = True
2 changes: 0 additions & 2 deletions browser/components/about/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,3 @@ FINAL_LIBRARY = 'browsercomps'
LOCAL_INCLUDES += [
'../build',
]

FAIL_ON_WARNINGS = True
2 changes: 0 additions & 2 deletions browser/components/build/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,3 @@ if CONFIG['OS_ARCH'] == 'WINNT':
# GTK2: Need to link with glib for GNOME shell service
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('cocoa', 'gtk2', 'gtk3'):
OS_LIBS += CONFIG['TK_LIBS']

FAIL_ON_WARNINGS = True
2 changes: 0 additions & 2 deletions browser/components/dirprovider/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,3 @@ FINAL_LIBRARY = 'browsercomps'
LOCAL_INCLUDES += [
'../build'
]

FAIL_ON_WARNINGS = True
2 changes: 0 additions & 2 deletions browser/components/feeds/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,5 @@ LOCAL_INCLUDES += [
'../build',
]

FAIL_ON_WARNINGS = True

with Files('**'):
BUG_COMPONENT = ('Firefox', 'RSS Discovery and Preview')
2 changes: 0 additions & 2 deletions browser/components/migration/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,5 @@ if CONFIG['OS_ARCH'] == 'WINNT':

FINAL_LIBRARY = 'browsercomps'

FAIL_ON_WARNINGS = True

with Files('**'):
BUG_COMPONENT = ('Firefox', 'Migration')
2 changes: 0 additions & 2 deletions browser/components/shell/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,5 @@ for var in ('MOZ_APP_NAME', 'MOZ_APP_VERSION'):

CXXFLAGS += CONFIG['TK_CFLAGS']

FAIL_ON_WARNINGS = True

with Files('**'):
BUG_COMPONENT = ('Firefox', 'Shell Integration')
2 changes: 1 addition & 1 deletion browser/config/mozconfigs/linux32/common-opt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export MOZILLA_OFFICIAL=1

export MOZ_TELEMETRY_REPORTING=1

# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors

# Package js shell.
Expand Down
2 changes: 1 addition & 1 deletion browser/config/mozconfigs/linux32/debug
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export MOZILLA_OFFICIAL=1

#Use ccache

# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors

# Package js shell.
Expand Down
2 changes: 1 addition & 1 deletion browser/config/mozconfigs/linux64/common-opt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export MOZILLA_OFFICIAL=1

export MOZ_TELEMETRY_REPORTING=1

# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors

# Package js shell.
Expand Down
2 changes: 1 addition & 1 deletion browser/config/mozconfigs/linux64/debug
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ MOZ_AUTOMATION_L10N_CHECK=0
# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1

# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors

# Package js shell.
Expand Down
2 changes: 1 addition & 1 deletion browser/config/mozconfigs/macosx-universal/common-opt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export MOZILLA_OFFICIAL=1

export MOZ_TELEMETRY_REPORTING=1

# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors

# Package js shell.
Expand Down
2 changes: 1 addition & 1 deletion browser/config/mozconfigs/macosx64/debug
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if test "${MOZ_UPDATE_CHANNEL}" = "nightly"; then
ac_add_options --with-macbundlename-prefix=Firefox
fi

# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors

# Package js shell.
Expand Down
2 changes: 1 addition & 1 deletion browser/config/mozconfigs/macosx64/debug-static-analysis
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ MOZ_AUTOMATION_L10N_CHECK=0
ac_add_options --enable-debug
ac_add_options --enable-dmd

# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors

ac_add_options --enable-clang-plugin
Expand Down
2 changes: 1 addition & 1 deletion browser/config/mozconfigs/macosx64/nightly
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if test "${MOZ_UPDATE_CHANNEL}" = "nightly"; then
ac_add_options --with-macbundlename-prefix=Firefox
fi

# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors

# Package js shell.
Expand Down
2 changes: 1 addition & 1 deletion browser/config/mozconfigs/win32/common-opt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export MOZ_TELEMETRY_REPORTING=1

. $topsrcdir/build/win32/mozconfig.vs2013-win64

# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors

# Enable Adobe Primetime CDM on 32-bit Windows in Mozilla builds.
Expand Down
2 changes: 1 addition & 1 deletion browser/config/mozconfigs/win32/debug
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export MOZILLA_OFFICIAL=1

. $topsrcdir/build/win32/mozconfig.vs2013-win64

# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors

# Package js shell.
Expand Down
2 changes: 1 addition & 1 deletion browser/config/mozconfigs/win64/common-opt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export MOZILLA_OFFICIAL=1

export MOZ_TELEMETRY_REPORTING=1

# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors

. $topsrcdir/build/win64/mozconfig.vs2013
Expand Down
2 changes: 1 addition & 1 deletion browser/config/mozconfigs/win64/debug
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ac_add_options --with-google-oauth-api-keyfile=${_google_oauth_api_keyfile}
# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1

# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors

# Package js shell.
Expand Down
2 changes: 2 additions & 0 deletions build/stlport/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,5 @@ if CONFIG['GNU_CXX']:
# Force to build a static library, instead of a fake library, without
# installing it in dist/lib.
NO_EXPAND_LIBS = True

ALLOW_COMPILER_WARNINGS = True
2 changes: 0 additions & 2 deletions caps/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,3 @@ LOCAL_INCLUDES += [
include('/ipc/chromium/chromium-config.mozbuild')

FINAL_LIBRARY = 'xul'

FAIL_ON_WARNINGS = True
2 changes: 0 additions & 2 deletions chrome/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,3 @@ LOCAL_INCLUDES += [

if CONFIG['MOZ_ENABLE_GTK']:
CXXFLAGS += CONFIG['TK_CFLAGS']

FAIL_ON_WARNINGS = True
26 changes: 14 additions & 12 deletions config/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -359,25 +359,27 @@ endif # CROSS_COMPILE
CFLAGS += $(MOZ_FRAMEPTR_FLAGS)
CXXFLAGS += $(MOZ_FRAMEPTR_FLAGS)

# Check for FAIL_ON_WARNINGS (Shorthand for Makefiles to request that we use
# the 'warnings as errors' compile flags)
# Check for ALLOW_COMPILER_WARNINGS (shorthand for Makefiles to request that we
# *don't* use the warnings-as-errors compile flags)

# NOTE: First, we clear FAIL_ON_WARNINGS[_DEBUG] if we're doing a Windows PGO
# build, since WARNINGS_AS_ERRORS has been suspected of causing isuses in that
# situation. (See bug 437002.)
# Don't use warnings-as-errors in Windows PGO builds because it is suspected of
# causing problems in that situation. (See bug 437002.)
ifeq (WINNT_1,$(OS_ARCH)_$(MOZ_PROFILE_GENERATE)$(MOZ_PROFILE_USE))
FAIL_ON_WARNINGS=
ALLOW_COMPILER_WARNINGS=1
endif # WINNT && (MOS_PROFILE_GENERATE ^ MOZ_PROFILE_USE)

# Check for normal version of flag, and add WARNINGS_AS_ERRORS if it's set to 1.
ifdef FAIL_ON_WARNINGS
# Never treat warnings as errors in clang-cl, because it warns about many more
# Don't use warnings-as-errors in clang-cl because it warns about many more
# things than MSVC does.
ifndef CLANG_CL
ifdef CLANG_CL
ALLOW_COMPILER_WARNINGS=1
endif # CLANG_CL

# Use warnings-as-errors if ALLOW_COMPILER_WARNINGS is not set to 1 (which
# includes the case where it's undefined).
ifneq (1,$(ALLOW_COMPILER_WARNINGS))
CXXFLAGS += $(WARNINGS_AS_ERRORS)
CFLAGS += $(WARNINGS_AS_ERRORS)
endif # CLANG_CL
endif # FAIL_ON_WARNINGS
endif # ALLOW_COMPILER_WARNINGS

ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_)
#// Currently, unless USE_STATIC_LIBS is defined, the multithreaded
Expand Down
3 changes: 3 additions & 0 deletions config/external/nss/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ else:
'/security/nss/lib/util/nssutil3',
'sqlite',
]

# XXX: We should fix these warnings.
ALLOW_COMPILER_WARNINGS = True
2 changes: 2 additions & 0 deletions db/sqlite3/src/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ EXPORTS += [
'sqlite3.h',
]

ALLOW_COMPILER_WARNINGS = True

if CONFIG['MOZ_FOLD_LIBS']:
# When folding libraries, sqlite is actually in the nss library.
FINAL_LIBRARY = 'nss'
Expand Down
2 changes: 0 additions & 2 deletions docshell/base/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ UNIFIED_SOURCES += [
'SerializedLoadContext.cpp',
]

FAIL_ON_WARNINGS = True

include('/ipc/chromium/chromium-config.mozbuild')

FINAL_LIBRARY = 'xul'
Expand Down
Loading

0 comments on commit f442870

Please sign in to comment.