--- a/config/config.mk
+++ b/config/config.mk
@@ -262,38 +262,16 @@ HOST_CFLAGS += $(HOST_OPTIMIZE_FLAGS)
HOST_CXXFLAGS += $(HOST_OPTIMIZE_FLAGS)
else
ifdef MOZ_OPTIMIZE
HOST_CFLAGS += $(MOZ_OPTIMIZE_FLAGS)
HOST_CXXFLAGS += $(MOZ_OPTIMIZE_FLAGS)
endif # MOZ_OPTIMIZE
endif # CROSS_COMPILE
-# Check for ALLOW_COMPILER_WARNINGS (shorthand for Makefiles to request that we
-# *don't* use the warnings-as-errors compile flags)
-
-# 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))
-ALLOW_COMPILER_WARNINGS=1
-endif # WINNT && (MOS_PROFILE_GENERATE ^ MOZ_PROFILE_USE)
-
-# Don't use warnings-as-errors in clang-cl because it warns about many more
-# things than MSVC does.
-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))
-COMPUTED_CXXFLAGS += $(WARNINGS_AS_ERRORS)
-COMPUTED_CFLAGS += $(WARNINGS_AS_ERRORS)
-endif # ALLOW_COMPILER_WARNINGS
-
COMPILE_CFLAGS = $(COMPUTED_CFLAGS) $(PGO_CFLAGS) $(MOZBUILD_CFLAGS) $(_DEPEND_CFLAGS) $(MK_COMPILE_DEFINES)
COMPILE_CXXFLAGS = $(COMPUTED_CXXFLAGS) $(PGO_CFLAGS) $(MOZBUILD_CXXFLAGS) $(_DEPEND_CFLAGS) $(MK_COMPILE_DEFINES)
COMPILE_CMFLAGS = $(OS_COMPILE_CMFLAGS) $(MOZBUILD_CMFLAGS)
COMPILE_CMMFLAGS = $(OS_COMPILE_CMMFLAGS) $(MOZBUILD_CMMFLAGS)
ASFLAGS += $(MOZBUILD_ASFLAGS)
ifndef CROSS_COMPILE
HOST_CFLAGS += $(RTL_FLAGS)
--- a/config/external/ffi/moz.build
+++ b/config/external/ffi/moz.build
@@ -4,17 +4,17 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
FINAL_LIBRARY = 'js'
if CONFIG['MOZ_SYSTEM_FFI']:
OS_LIBS += CONFIG['MOZ_FFI_LIBS']
else:
- ALLOW_COMPILER_WARNINGS = True
+ AllowCompilerWarnings()
NoVisibilityFlags()
CONFIGURE_DEFINE_FILES += [
'../../../js/src/ctypes/libffi/fficonfig.h',
]
GENERATED_FILES += [
'../../../js/src/ctypes/libffi/include/ffi.h',
]
--- a/config/external/icu/defs.mozbuild
+++ b/config/external/icu/defs.mozbuild
@@ -28,17 +28,17 @@ if CONFIG['MOZ_DEBUG']:
# ICU requires RTTI
if CONFIG['GNU_CXX']:
CXXFLAGS += ['-frtti']
elif CONFIG['OS_TARGET'] == 'WINNT':
CXXFLAGS += ['-GR']
DisableStlWrapping()
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
# We allow compiler warnings, but we can at least cut down on spammy
# warnings that get triggered for every file.
if CONFIG['CLANG_CL']:
CFLAGS += [
'-Wno-macro-redefined',
'-Wno-microsoft-include',
]
--- a/config/external/nspr/ds/moz.build
+++ b/config/external/nspr/ds/moz.build
@@ -8,17 +8,17 @@ if CONFIG['MOZ_FOLD_LIBS']:
Library('plds4')
else:
SharedLibrary('plds4')
SOURCES += ['/nsprpub/lib/ds/plvrsion.c']
USE_LIBS += ['nspr4']
# We allow warnings for third-party code that can be updated from upstream.
# TODO: fix NSPR warnings and remove this
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
DEFINES['_NSPR_BUILD_'] = True
LOCAL_INCLUDES += [
'/config/external/nspr',
'/nsprpub/pr/include',
]
--- a/config/external/nspr/libc/moz.build
+++ b/config/external/nspr/libc/moz.build
@@ -8,17 +8,17 @@ if CONFIG['MOZ_FOLD_LIBS']:
Library('plc4')
else:
SharedLibrary('plc4')
SOURCES += ['/nsprpub/lib/libc/src/plvrsion.c']
USE_LIBS += ['nspr4']
# We allow warnings for third-party code that can be updated from upstream.
# TODO: fix NSPR warnings and remove this
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
DEFINES['_NSPR_BUILD_'] = True
LOCAL_INCLUDES += [
'/config/external/nspr',
]
EXPORTS.nspr += [
--- a/config/external/nspr/pr/moz.build
+++ b/config/external/nspr/pr/moz.build
@@ -6,17 +6,17 @@
if CONFIG['MOZ_FOLD_LIBS']:
Library('nspr4')
else:
SharedLibrary('nspr4')
# We allow warnings for third-party code that can be updated from upstream.
# TODO: fix NSPR warnings and remove this
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
DEFINES['_NSPR_BUILD_'] = True
if CONFIG['OS_ARCH'] == 'Linux':
OS_LIBS += CONFIG['REALTIME_LIBS']
DEFINES.update(
LINUX=True,
HAVE_FCNTL_FILE_LOCKING=True,
HAVE_POINTER_LOCALTIME_R=True,
--- a/db/sqlite3/src/moz.build
+++ b/db/sqlite3/src/moz.build
@@ -5,17 +5,17 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
NoVisibilityFlags()
EXPORTS += [
'sqlite3.h',
]
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
if CONFIG['MOZ_FOLD_LIBS']:
# When folding libraries, sqlite is actually in the nss library.
FINAL_LIBRARY = 'nss'
else:
# The final library is in config/external/sqlite
FINAL_LIBRARY = 'sqlite'
--- a/extensions/spellcheck/hunspell/src/moz.build
+++ b/extensions/spellcheck/hunspell/src/moz.build
@@ -23,16 +23,16 @@ DEFINES['HUNSPELL_STATIC'] = True
FINAL_LIBRARY = 'xul'
LOCAL_INCLUDES += [
'../glue',
]
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
include('/ipc/chromium/chromium-config.mozbuild')
if CONFIG['CLANG_CXX'] or CONFIG['CLANG_CL']:
CXXFLAGS += [
'-Wno-implicit-fallthrough',
]
--- a/gfx/angle/moz.build
+++ b/gfx/angle/moz.build
@@ -193,11 +193,11 @@ DEFINES['ANGLE_ENABLE_ESSL'] = "1"
DEFINES['ANGLE_ENABLE_KEYEDMUTEX'] = "1"
EXPORTS.angle += [ 'include/GLSLANG/ShaderLang.h', 'include/GLSLANG/ShaderVars.h', 'include/platform/Platform.h' ]
EXPORTS.angle.KHR += [ 'include/KHR/khrplatform.h' ]
LOCAL_INCLUDES += [ 'include', 'src', 'src/common/third_party/base']
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
FINAL_LIBRARY = 'gkmedias'
--- a/gfx/angle/src/libANGLE/moz.build
+++ b/gfx/angle/src/libANGLE/moz.build
@@ -412,10 +412,10 @@ Library('libANGLE')
SOURCES['renderer/d3d/HLSLCompiler.cpp'].flags += ['-DANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES=\'{ TEXT("d3dcompiler_47.dll"), TEXT("d3dcompiler_46.dll"), TEXT("d3dcompiler_43.dll") }\'']
if CONFIG['MOZ_HAS_WINSDK_WITH_D3D']:
SOURCES['renderer/d3d/d3d11/SwapChain11.cpp'].flags += ['-DANGLE_RESOURCE_SHARE_TYPE=D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX']
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
--- a/gfx/cairo/cairo/src/moz.build
+++ b/gfx/cairo/cairo/src/moz.build
@@ -174,17 +174,17 @@ UNIFIED_SOURCES += [
'cairo-unicode.c',
'cairo-user-font.c',
'cairo-version.c',
'cairo-wideint.c',
'cairo.c',
]
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
FINAL_LIBRARY = 'gkmedias'
DEFINES['PACKAGE_VERSION'] = '"moz"'
DEFINES['PACKAGE_BUGREPORT'] = '"http://bugzilla.mozilla.org/"'
for var in ('CAIRO_HAS_PTHREAD', '_GNU_SOURCE'):
DEFINES[var] = True
--- a/gfx/cairo/libpixman/src/moz.build
+++ b/gfx/cairo/libpixman/src/moz.build
@@ -58,17 +58,17 @@ SOURCES += [
'pixman-solid-fill.c',
'pixman-trap.c',
'pixman-utils.c',
'pixman-x86.c',
'pixman.c',
]
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
FINAL_LIBRARY = 'gkmedias'
LOCAL_INCLUDES += [
'../../cairo/src',
]
if CONFIG['MOZ_USE_PTHREADS']:
DEFINES['HAVE_PTHREAD_SETSPECIFIC'] = True
--- a/gfx/graphite2/src/moz.build
+++ b/gfx/graphite2/src/moz.build
@@ -63,17 +63,17 @@ SOURCES += [
'NameTable.cpp',
]
# tell graphite2 not to export symbols, we'll be linking it directly with
# thebes
DEFINES['GRAPHITE2_STATIC'] = True
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
FINAL_LIBRARY = 'gkmedias'
DEFINES['PACKAGE_VERSION'] = '"moz"'
DEFINES['PACKAGE_BUGREPORT'] = '"http://bugzilla.mozilla.org/"'
# disable features we don't need in the graphite2 code, to reduce code size
for var in ('GRAPHITE2_NFILEFACE', 'GRAPHITE2_NTRACING', 'GRAPHITE2_NSEGCACHE'):
--- a/gfx/harfbuzz/src/moz.build
+++ b/gfx/harfbuzz/src/moz.build
@@ -67,17 +67,17 @@ if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']
'hb-glib.h',
]
UNIFIED_SOURCES += [
'hb-glib.cc',
]
CXXFLAGS += CONFIG['GLIB_CFLAGS']
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
FINAL_LIBRARY = 'gkmedias'
DEFINES['PACKAGE_VERSION'] = '"moz"'
DEFINES['PACKAGE_BUGREPORT'] = '"http://bugzilla.mozilla.org/"'
DEFINES['HAVE_OT'] = 1
DEFINES['HB_NO_MT'] = True
DEFINES['HB_NO_UNICODE_FUNCS'] = True
--- a/gfx/ots/src/moz.build
+++ b/gfx/ots/src/moz.build
@@ -48,17 +48,17 @@ UNIFIED_SOURCES += [
'sill.cc',
'vdmx.cc',
'vhea.cc',
'vmtx.cc',
'vorg.cc',
]
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
FINAL_LIBRARY = 'gkmedias'
DEFINES['PACKAGE_VERSION'] = '"moz"'
DEFINES['PACKAGE_BUGREPORT'] = '"http://bugzilla.mozilla.org/"'
DEFINES['OTS_GRAPHITE'] = 1
USE_LIBS += [
--- a/gfx/sfntly/cpp/src/moz.build
+++ b/gfx/sfntly/cpp/src/moz.build
@@ -61,13 +61,13 @@ UNIFIED_SOURCES += [
'sfntly/table/truetype/loca_table.cc',
'sfntly/tag.cc',
'sfntly/tools/subsetter/glyph_table_subsetter.cc',
'sfntly/tools/subsetter/subsetter.cc',
'sfntly/tools/subsetter/table_subsetter_impl.cc',
]
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
FINAL_LIBRARY = 'gkmedias'
DEFINES['SFNTLY_NO_EXCEPTION'] = 1
--- a/gfx/skia/moz.build
+++ b/gfx/skia/moz.build
@@ -674,17 +674,17 @@ else:
SOURCES += [
'skia/src/opts/SkBitmapProcState_opts_none.cpp',
'skia/src/opts/SkBlitMask_opts_none.cpp',
'skia/src/opts/SkBlitRow_opts_none.cpp',
]
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
FINAL_LIBRARY = 'gkmedias'
LOCAL_INCLUDES += [
'skia/include/c',
'skia/include/config',
'skia/include/core',
'skia/include/effects',
'skia/include/gpu',
--- a/intl/hyphenation/hyphen/moz.build
+++ b/intl/hyphenation/hyphen/moz.build
@@ -11,9 +11,9 @@ SOURCES += [
FINAL_LIBRARY = 'xul'
LOCAL_INCLUDES += [
'../glue',
]
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
--- a/ipc/chromium/src/third_party/moz.build
+++ b/ipc/chromium/src/third_party/moz.build
@@ -53,13 +53,13 @@ if os_linux:
if os_solaris:
SOURCES += [
'libevent/devpoll.c',
'libevent/evport.c',
]
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
Library('libevent')
FINAL_LIBRARY = 'xul'
--- a/media/ffvpx/ffvpxcommon.mozbuild
+++ b/media/ffvpx/ffvpxcommon.mozbuild
@@ -28,17 +28,17 @@ if CONFIG['FFVPX_ASFLAGS']:
]
else:
# Default to unix, similar to how ASFLAGS setup works in configure.in
ASFLAGS += ['-Pconfig_unix64.asm']
LOCAL_INCLUDES += ['/media/ffvpx']
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
# Suppress warnings in third-party code.
if CONFIG['GNU_CC']:
CFLAGS += [
'-Wno-parentheses',
'-Wno-pointer-sign',
'-Wno-sign-compare',
'-Wno-switch',
--- a/media/libaom/moz.build
+++ b/media/libaom/moz.build
@@ -78,17 +78,17 @@ else:
# Generic C-only configuration
EXPORTS.aom += files['GENERIC_EXPORTS']
SOURCES += files['GENERIC_SOURCES']
ASFLAGS += [ '-I%s/media/libaom/config/generic/' % TOPSRCDIR ]
LOCAL_INCLUDES += [ '/media/libaom/config/generic/' ]
EXPORTS.aom += [ 'config/generic/aom_config.h' ]
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
FINAL_LIBRARY = 'gkmedias'
if CONFIG['OS_TARGET'] == 'Android':
# Older versions of the Android NDK don't pre-define anything to indicate
# the OS they're on, so do it for them.
DEFINES['__linux__'] = True
--- a/media/libav/moz.build
+++ b/media/libav/moz.build
@@ -62,17 +62,17 @@ if CONFIG['_MSC_VER']:
# the lgpl shared library, since it does not yet use system headers. This is
# also used on linux for the time being, to avoid having to patch libav code.
#
# TODO: Remove header and patch libav once OS X supports system headers
if CONFIG['OS_ARCH'] != 'WINNT':
SOURCES['libavcodec/avfft.c'].flags += ['-include', 'avfft_perms.h']
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
if CONFIG['MOZ_DEBUG']:
# Enable all assertions in debug builds.
DEFINES['ASSERT_LEVEL'] = 2
elif not CONFIG['RELEASE_OR_BETA']:
# Enable fast assertions in opt builds of Nightly and Aurora.
DEFINES['ASSERT_LEVEL'] = 1
--- a/media/libcubeb/src/moz.build
+++ b/media/libcubeb/src/moz.build
@@ -84,9 +84,9 @@ if CONFIG['OS_TARGET'] == 'Android':
DEFINES['USE_AUDIOTRACK'] = True
FINAL_LIBRARY = 'gkmedias'
CFLAGS += CONFIG['MOZ_ALSA_CFLAGS']
CFLAGS += CONFIG['MOZ_PULSEAUDIO_CFLAGS']
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
--- a/media/libjpeg/moz.build
+++ b/media/libjpeg/moz.build
@@ -150,12 +150,12 @@ else: # No SIMD support?
SOURCES += [
'jsimd_none.c',
]
ASFLAGS += CONFIG['LIBJPEG_TURBO_ASFLAGS']
ASFLAGS += ['-I%s/media/libjpeg/simd/' % TOPSRCDIR]
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
FINAL_LIBRARY = 'gkmedias'
--- a/media/libmkv/moz.build
+++ b/media/libmkv/moz.build
@@ -22,9 +22,9 @@ SOURCES += [
'EbmlBufferWriter.c',
'EbmlWriter.c',
'WebMElement.c',
]
FINAL_LIBRARY = 'gkmedias'
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
--- a/media/libnestegg/src/moz.build
+++ b/media/libnestegg/src/moz.build
@@ -6,9 +6,9 @@
UNIFIED_SOURCES += [
'nestegg.c',
]
FINAL_LIBRARY = 'gkmedias'
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
--- a/media/libopus/moz.build
+++ b/media/libopus/moz.build
@@ -10,17 +10,17 @@ with Files('*'):
EXPORTS.opus += [
'include/opus.h',
'include/opus_defines.h',
'include/opus_multistream.h',
'include/opus_types.h',
]
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
FINAL_LIBRARY = 'gkmedias'
DEFINES['OPUS_BUILD'] = True
DEFINES['OPUS_VERSION'] = '"v1.2.1-mozilla"'
DEFINES['USE_ALLOCA'] = True
# Don't export symbols
--- a/media/libpng/moz.build
+++ b/media/libpng/moz.build
@@ -58,12 +58,12 @@ if CONFIG['HAVE_ALTIVEC']:
if CONFIG['MOZ_TREE_FREETYPE']:
DEFINES['FT_CONFIG_OPTION_USE_PNG'] = True
Library('mozpng')
FINAL_LIBRARY = 'gkmedias'
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
if CONFIG['GNU_CC']:
CFLAGS += ['-std=c89']
--- a/media/libsoundtouch/src/moz.build
+++ b/media/libsoundtouch/src/moz.build
@@ -38,14 +38,14 @@ if CONFIG['OS_ARCH'] != 'WINNT':
# GCC/Clang require permissions to be explicitly set for the soundtouch
# header.
CXXFLAGS += ['-include', SRCDIR + '/soundtouch_perms.h']
else:
# Windows need alloca renamed to _alloca
DEFINES['alloca'] = '_alloca'
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
FINAL_LIBRARY = 'lgpllibs'
# Use abort() instead of exception in SoundTouch.
DEFINES['ST_NO_EXCEPTION_HANDLING'] = 1
--- a/media/libspeex_resampler/src/moz.build
+++ b/media/libspeex_resampler/src/moz.build
@@ -11,17 +11,17 @@ EXPORTS.speex += [
]
SOURCES += [
'resample.c',
'simd_detect.cpp',
]
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
FINAL_LIBRARY = 'gkmedias'
# We don't compile the full speex codec, only the resampler.
DEFINES['OUTSIDE_SPEEX'] = True
DEFINES['EXPORT'] = ''
--- a/media/libstagefright/moz.build
+++ b/media/libstagefright/moz.build
@@ -133,17 +133,17 @@ LOCAL_INCLUDES += [
'system/core/include',
]
TEST_DIRS += [
'gtest',
]
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
FINAL_LIBRARY = 'xul'
# Suppress warnings in third-party code.
if CONFIG['_MSC_VER']:
CFLAGS += [
'-wd4013', # 'function' undefined; assuming extern returning int
'-wd4101', # unreferenced local variable
--- a/media/libtheora/moz.build
+++ b/media/libtheora/moz.build
@@ -9,17 +9,17 @@ with Files('*'):
EXPORTS.theora += [
'include/theora/codec.h',
'include/theora/theoradec.h',
'include/theora/theoraenc.h',
]
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
FINAL_LIBRARY = 'gkmedias'
# The encoder is currently not included.
DEFINES['THEORA_DISABLE_ENCODE'] = True
# Suppress warnings in third-party code.
if CONFIG['GNU_CC'] or CONFIG['CLANG_CL']:
--- a/media/libtremor/lib/moz.build
+++ b/media/libtremor/lib/moz.build
@@ -27,9 +27,9 @@ if CONFIG['OS_ARCH'] == 'AIX':
if CONFIG['TARGET_CPU'] == 'arm' and CONFIG['GNU_CC'] and not CONFIG['MOZ_THUMB2']:
DEFINES['_ARM_ASSEM_'] = True
LOCAL_INCLUDES += [
'/media/libtremor/include/tremor',
]
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
--- a/media/libvorbis/moz.build
+++ b/media/libvorbis/moz.build
@@ -44,15 +44,15 @@ LOCAL_INCLUDES += ['lib']
if CONFIG['OS_ARCH'] == 'AIX':
DEFINES['alloca'] = '__alloca'
if CONFIG['OS_ARCH'] == 'SunOS':
DEFINES['HAVE_ALLOCA_H'] = True
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
FINAL_LIBRARY = 'gkmedias'
# Suppress warnings in third-party code.
if CONFIG['GNU_CC']:
CFLAGS += ['-Wno-uninitialized']
--- a/media/libvpx/moz.build
+++ b/media/libvpx/moz.build
@@ -74,17 +74,17 @@ elif CONFIG['CPU_ARCH'] == 'arm':
else:
# Generic C-only configuration
EXPORTS.vpx += files['GENERIC_EXPORTS']
SOURCES += files['GENERIC_SOURCES']
ASFLAGS += [ '-I%s/media/libvpx/config/generic/' % TOPSRCDIR ]
LOCAL_INCLUDES += [ '/media/libvpx/config/generic/' ]
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
FINAL_LIBRARY = 'gkmedias'
DEFINES['HAVE_CONFIG_H'] = 'vpx_config.h'
if CONFIG['OS_TARGET'] == 'Android':
# Older versions of the Android NDK don't pre-define anything to indicate
# the OS they're on, so do it for them.
--- a/media/libyuv/moz.build
+++ b/media/libyuv/moz.build
@@ -30,9 +30,9 @@ libyuv_non_unified_sources = [
GYP_DIRS += ['libyuv']
GYP_DIRS['libyuv'].input = 'libyuv/libyuv.gyp'
GYP_DIRS['libyuv'].variables = gyp_vars_copy
GYP_DIRS['libyuv'].sandbox_vars['FINAL_LIBRARY'] = 'xul'
GYP_DIRS['libyuv'].non_unified_sources += libyuv_non_unified_sources
# We allow warnings for third-party code that can be updated from upstream.
-GYP_DIRS['libyuv'].sandbox_vars['ALLOW_COMPILER_WARNINGS'] = True
+GYP_DIRS['libyuv'].sandbox_vars['COMPILE_FLAGS'] = {'WARNINGS_AS_ERRORS': []}
--- a/media/mtransport/third_party/moz.build
+++ b/media/mtransport/third_party/moz.build
@@ -65,18 +65,18 @@ nrappkit_non_unified_sources = [
'nrappkit/src/util/libekr/r_time.c',
'nrappkit/src/util/p_buf.c',
'nrappkit/src/util/util.c',
]
GYP_DIRS['nICEr'].input = 'nICEr/nicer.gyp'
GYP_DIRS['nICEr'].variables = gyp_vars_copy
# We allow warnings for third-party code that can be updated from upstream.
-GYP_DIRS['nICEr'].sandbox_vars['ALLOW_COMPILER_WARNINGS'] = True
+GYP_DIRS['nICEr'].sandbox_vars['COMPILE_FLAGS'] = {'WARNINGS_AS_ERRORS': []}
GYP_DIRS['nICEr'].sandbox_vars['FINAL_LIBRARY'] = 'xul'
GYP_DIRS['nICEr'].non_unified_sources += nICEr_non_unified_sources
GYP_DIRS['nrappkit'].input = 'nrappkit/nrappkit.gyp'
GYP_DIRS['nrappkit'].variables = gyp_vars_copy
# We allow warnings for third-party code that can be updated from upstream.
-GYP_DIRS['nrappkit'].sandbox_vars['ALLOW_COMPILER_WARNINGS'] = True
+GYP_DIRS['nrappkit'].sandbox_vars['COMPILE_FLAGS'] = {'WARNINGS_AS_ERRORS': []}
GYP_DIRS['nrappkit'].sandbox_vars['FINAL_LIBRARY'] = 'xul'
GYP_DIRS['nrappkit'].non_unified_sources += nrappkit_non_unified_sources
--- a/media/sphinxbase/moz.build
+++ b/media/sphinxbase/moz.build
@@ -75,11 +75,11 @@ if CONFIG['GNU_CC']:
'-Wno-sign-compare',
]
# Add define required of third party code.
if CONFIG['GNU_CC']:
DEFINES['HAVE_CONFIG_H'] = True
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
FINAL_LIBRARY = 'gkmedias'
--- a/media/webrtc/moz.build
+++ b/media/webrtc/moz.build
@@ -66,33 +66,33 @@ if CONFIG['MOZ_VALGRIND']:
elif CONFIG['MOZ_ASAN']:
gyp_vars_copy.update(build_for_tool="asan")
elif CONFIG['MOZ_TSAN']:
gyp_vars_copy.update(build_for_tool="tsan")
GYP_DIRS['trunk'].input = 'trunk/peerconnection.gyp'
GYP_DIRS['trunk'].variables = gyp_vars_copy
# We allow warnings for third-party code that can be updated from upstream.
-GYP_DIRS['trunk'].sandbox_vars['ALLOW_COMPILER_WARNINGS'] = True
+GYP_DIRS['trunk'].sandbox_vars['COMPILE_FLAGS'] = {'WARNINGS_AS_ERRORS': []}
GYP_DIRS['trunk'].sandbox_vars['FINAL_LIBRARY'] = 'webrtc'
GYP_DIRS['trunk'].non_unified_sources += webrtc_non_unified_sources
if CONFIG['MOZ_WEBRTC_SIGNALING']:
DIRS += [
'signaling/src/common',
'signaling/src/jsep',
'signaling/src/media-conduit',
'signaling/src/mediapipeline',
'signaling/src/peerconnection',
'signaling/src/sdp'
]
GYP_DIRS += ['trunk/third_party/gflags']
GYP_DIRS['trunk/third_party/gflags'].input = 'trunk/third_party/gflags/gflags.gyp'
GYP_DIRS['trunk/third_party/gflags'].variables = gyp_vars_copy
- GYP_DIRS['trunk/third_party/gflags'].sandbox_vars['ALLOW_COMPILER_WARNINGS'] = True
+ GYP_DIRS['trunk/third_party/gflags'].sandbox_vars['COMPILE_FLAGS'] = {'WARNINGS_AS_ERRORS': []}
if CONFIG['_MSC_VER']:
# Avoid warnings from third-party code that we can not modify.
if CONFIG['CLANG_CL']:
CXXFLAGS += ['-Wno-invalid-source-encoding']
else:
CXXFLAGS += ['-validate-charset-']
--- a/media/webrtc/trunk/gtest/moz.build
+++ b/media/webrtc/trunk/gtest/moz.build
@@ -4,17 +4,17 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Once we have gn support available in the build system
# (see Bug 1336429) we can use the gn build files directly
# rather than building things here.
include('/media/webrtc/webrtc.mozbuild')
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
DEFINES['GTEST_RELATIVE_PATH'] = True
DEFINES['WEBRTC_APM_DEBUG_DUMP'] = True
DEFINES['WEBRTC_INTELLIGIBILITY_ENHANCER'] = 0
DEFINES['WEBRTC_MOZILLA_BUILD'] = 1
# Hit build errors on windows with xutility otherwise
DisableStlWrapping()
--- a/modules/brotli/moz.build
+++ b/modules/brotli/moz.build
@@ -18,17 +18,17 @@ UNIFIED_SOURCES += [
'common/dictionary.c',
'dec/bit_reader.c',
'dec/decode.c',
'dec/huffman.c',
'dec/state.c',
]
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
CFLAGS += ['-DBROTLI_BUILD_PORTABLE']
Library('brotli')
HostProgram('brotli')
HOST_SOURCES += UNIFIED_SOURCES
--- a/modules/freetype2/moz.build
+++ b/modules/freetype2/moz.build
@@ -8,17 +8,17 @@ DEFINES['FT2_BUILD_LIBRARY'] = True
CFLAGS += ['-std=c99']
LOCAL_INCLUDES += [
'include',
]
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
# base components
SOURCES += [
'src/base/ftbase.c',
'src/base/ftdebug.c',
'src/base/ftinit.c',
'src/base/ftsystem.c',
]
--- a/modules/pdfium/moz.build
+++ b/modules/pdfium/moz.build
@@ -552,14 +552,14 @@ DEFINES['USE_LIBJPEG_TURBO'] = True
LOCAL_INCLUDES += [
'/media/libjpeg',
]
USE_LIBS += [
'media_libjpeg',
]
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
GeckoSharedLibrary('pdfium', linkage=None)
if CONFIG['OS_TARGET'] == 'WINNT':
DEFFILE = SRCDIR + '/pdfium.def'
--- a/modules/woff2/moz.build
+++ b/modules/woff2/moz.build
@@ -11,11 +11,11 @@ UNIFIED_SOURCES += [
'src/table_tags.cc',
'src/variable_length.cc',
'src/woff2_common.cc',
'src/woff2_dec.cc',
'src/woff2_out.cc',
]
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
Library('woff2')
--- a/modules/xz-embedded/moz.build
+++ b/modules/xz-embedded/moz.build
@@ -14,17 +14,17 @@ EXPORTS += [
UNIFIED_SOURCES += [
'src/xz_crc32.c',
'src/xz_crc64.c',
'src/xz_dec_bcj.c',
'src/xz_dec_lzma2.c',
'src/xz_dec_stream.c',
]
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
if CONFIG['TARGET_CPU'].startswith('arm'):
# Accept arm, armv7, etc.
if CONFIG['MOZ_THUMB2']:
DEFINES['XZ_DEC_ARMTHUMB'] = 1
else:
DEFINES['XZ_DEC_ARM'] = 1
elif '86' in CONFIG['TARGET_CPU']:
--- a/netwerk/sctp/src/moz.build
+++ b/netwerk/sctp/src/moz.build
@@ -39,17 +39,17 @@ if CONFIG['OS_TARGET'] == 'Android':
'ifaddrs_android.cpp',
]
Library('nksctp_s')
include('/ipc/chromium/chromium-config.mozbuild')
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
FINAL_LIBRARY = 'xul'
LOCAL_INCLUDES += [
'/dom/base',
'/netwerk/base',
]
--- a/other-licenses/snappy/moz.build
+++ b/other-licenses/snappy/moz.build
@@ -13,17 +13,17 @@ EXPORTS.snappy += [
UNIFIED_SOURCES += [
'src/snappy-c.cc',
'src/snappy-sinksource.cc',
'src/snappy-stubs-internal.cc',
'src/snappy.cc',
]
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
FINAL_LIBRARY = 'xul'
# Suppress warnings in third-party code.
if CONFIG['GNU_CXX']:
CXXFLAGS += [
'-Wno-sign-compare',
'-Wno-unused-function'
--- a/python/mozbuild/mozbuild/frontend/context.py
+++ b/python/mozbuild/mozbuild/frontend/context.py
@@ -1047,25 +1047,16 @@ SUBCONTEXTS = {cls.__name__: cls for cls
# This defines the set of mutable global variables.
#
# Each variable is a tuple of:
#
# (storage_type, input_types, docs)
VARIABLES = {
- 'ALLOW_COMPILER_WARNINGS': (bool, bool,
- """Whether to allow compiler warnings (i.e. *not* treat them as
- errors).
-
- This is commonplace (almost mandatory, in fact) in directories
- containing third-party code that we regularly update from upstream and
- thus do not control, but is otherwise discouraged.
- """),
-
# Variables controlling reading of other frontend files.
'ANDROID_GENERATED_RESFILES': (StrictOrderingOnAppendList, list,
"""Android resource files generated as part of the build.
This variable contains a list of files that are expected to be
generated (often by preprocessing) into a 'res' directory as
part of the build process, and subsequently merged into an APK
file.
@@ -2406,16 +2397,26 @@ DEPRECATION_HINTS = {
SimplePrograms(['foo', 'bar'])
instead of
SIMPLE_PROGRAMS += ['foo', 'bar']"
''',
+ 'ALLOW_COMPILER_WARNINGS': '''
+ Please use
+
+ AllowCompilerWarnings()
+
+ instead of
+
+ ALLOW_COMPILER_WARNINGS = True
+ ''',
+
'FORCE_SHARED_LIB': '''
Please use
SharedLibrary('foo')
instead of
Library('foo') [ or LIBRARY_NAME = 'foo' ]
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -917,17 +917,16 @@ class TreeMetadataEmitter(LoggingMixin):
for obj in self._process_xpidl(context):
yield obj
# Proxy some variables as-is until we have richer classes to represent
# them. We should aim to keep this set small because it violates the
# desired abstraction of the build definition away from makefiles.
passthru = VariablePassthru(context)
varlist = [
- 'ALLOW_COMPILER_WARNINGS',
'ANDROID_APK_NAME',
'ANDROID_APK_PACKAGE',
'ANDROID_GENERATED_RESFILES',
'EXTRA_DSO_LDOPTS',
'RCFILE',
'RESFILE',
'RCINCLUDE',
'DEFFILE',
--- a/security/moz.build
+++ b/security/moz.build
@@ -100,19 +100,19 @@ else:
GYP_DIRS['nss'].input = 'nss/nss.gyp'
GYP_DIRS['nss'].variables = gyp_vars
sandbox_vars = {
# NSS explicitly exports its public symbols
# with linker scripts.
'COMPILE_FLAGS': {
'VISIBILITY': [],
+ # XXX: We should fix these warnings.
+ 'WARNINGS_AS_ERRORS': [],
},
- # XXX: We should fix these warnings.
- 'ALLOW_COMPILER_WARNINGS': True,
# NSS' build system doesn't currently build NSS with PGO.
# We could probably do so, but not without a lot of
# careful consideration.
'NO_PGO': True,
}
if CONFIG['OS_TARGET'] == 'WINNT':
if CONFIG['CPU_ARCH'] == 'x86':
# This should really be the default.
--- a/toolkit/components/protobuf/moz.build
+++ b/toolkit/components/protobuf/moz.build
@@ -234,17 +234,17 @@ SOURCES += [
'src/google/protobuf/util/internal/protostream_objectsource.cc', # GetCurrentTime conflict in winbase.h
'src/google/protobuf/util/internal/protostream_objectwriter.cc', # GetCurrentTime conflict in winbase.h
'src/google/protobuf/util/message_differencer.cc',
'src/google/protobuf/util/time_util.cc', # GetCurrentTime conflict in winbase.h
'src/google/protobuf/wire_format.cc', # GetMessage conflict in windows.h
]
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
FINAL_LIBRARY = 'xul'
DEFINES['GOOGLE_PROTOBUF_NO_RTTI'] = True
DEFINES['GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER'] = True
# Suppress warnings in third-party code.
if CONFIG['GNU_CXX']:
--- a/toolkit/crashreporter/breakpad-client/linux/moz.build
+++ b/toolkit/crashreporter/breakpad-client/linux/moz.build
@@ -26,17 +26,17 @@ if CONFIG['OS_TARGET'] == 'Linux' or CON
if CONFIG['OS_TARGET'] == 'Android':
DEFINES['ANDROID_NDK_MAJOR_VERSION'] = CONFIG['ANDROID_NDK_MAJOR_VERSION']
DEFINES['ANDROID_NDK_MINOR_VERSION'] = CONFIG['ANDROID_NDK_MINOR_VERSION']
LOCAL_INCLUDES += [
'/toolkit/crashreporter/google-breakpad/src/common/android/include',
]
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
FINAL_LIBRARY = 'xul'
if CONFIG['OS_TARGET'] == 'Android' and CONFIG['CPU_ARCH'] == 'x86':
# The NDK's user.h defines this struct with a different name.
DEFINES['user_fpxregs_struct'] = 'user_fxsr_struct'
include('/toolkit/crashreporter/crashreporter.mozbuild')
--- a/toolkit/crashreporter/breakpad-client/mac/handler/moz.build
+++ b/toolkit/crashreporter/breakpad-client/mac/handler/moz.build
@@ -7,17 +7,17 @@
UNIFIED_SOURCES += [
'breakpad_nlist_64.cc',
'dynamic_images.cc',
'exception_handler.cc',
'minidump_generator.cc',
]
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
FINAL_LIBRARY = 'xul'
LOCAL_INCLUDES += [
'/toolkit/crashreporter/breakpad-client',
'/toolkit/crashreporter/google-breakpad/src',
]
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/common/mac/moz.build
@@ -38,15 +38,15 @@ SOURCES += [
'HTTPMultipartUpload.m',
'MachIPC.mm',
'string_utilities.cc',
]
Library('breakpad_mac_common_s')
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
FINAL_LIBRARY = 'xul'
CMFLAGS += ['-std=c99']
include('/toolkit/crashreporter/crashreporter.mozbuild')
--- a/toolkit/crashreporter/google-breakpad/src/common/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/common/moz.build
@@ -60,13 +60,13 @@ if CONFIG['OS_TARGET'] == 'Android':
]
LOCAL_INCLUDES += [
'/toolkit/crashreporter/google-breakpad/src/common/android/include',
]
Library('breakpad_common_s')
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
FINAL_LIBRARY = 'xul'
include('/toolkit/crashreporter/crashreporter.mozbuild')
--- a/toolkit/crashreporter/google-breakpad/src/processor/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/processor/moz.build
@@ -56,11 +56,11 @@ UNIFIED_SOURCES += [
DEFINES['BPLOG_MINIMUM_SEVERITY'] = 'SEVERITY_ERROR'
Library('breakpad_processor')
# Don't use the STL wrappers in the crashreporter clients
DisableStlWrapping()
# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
+AllowCompilerWarnings()
include('/toolkit/crashreporter/crashreporter.mozbuild')