Bug 1403346 - Replace all uses of ALLOW_COMPILER_WARNINGS with a template, remove ALLOW_COMPILER_WARNINGS. r=glandium

MozReview-Commit-ID: 1G2o4fy74cf
This commit is contained in:
Chris Manchester 2017-10-25 15:12:09 -07:00
Родитель 89f38841e2
Коммит c86173526a
56 изменённых файлов: 66 добавлений и 88 удалений

Просмотреть файл

@ -267,28 +267,6 @@ 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)

2
config/external/ffi/moz.build поставляемый
Просмотреть файл

@ -9,7 +9,7 @@ FINAL_LIBRARY = 'js'
if CONFIG['MOZ_SYSTEM_FFI']:
OS_LIBS += CONFIG['MOZ_FFI_LIBS']
else:
ALLOW_COMPILER_WARNINGS = True
AllowCompilerWarnings()
NoVisibilityFlags()
CONFIGURE_DEFINE_FILES += [

2
config/external/icu/defs.mozbuild поставляемый
Просмотреть файл

@ -33,7 +33,7 @@ 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.

2
config/external/nspr/ds/moz.build поставляемый
Просмотреть файл

@ -13,7 +13,7 @@ else:
# 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

2
config/external/nspr/libc/moz.build поставляемый
Просмотреть файл

@ -13,7 +13,7 @@ else:
# 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

2
config/external/nspr/pr/moz.build поставляемый
Просмотреть файл

@ -11,7 +11,7 @@ else:
# 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':

Просмотреть файл

@ -10,7 +10,7 @@ EXPORTS += [
]
# 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.

Просмотреть файл

@ -28,7 +28,7 @@ LOCAL_INCLUDES += [
]
# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True
AllowCompilerWarnings()
include('/ipc/chromium/chromium-config.mozbuild')

Просмотреть файл

@ -198,6 +198,6 @@ 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'

Просмотреть файл

@ -417,5 +417,5 @@ 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()

Просмотреть файл

@ -179,7 +179,7 @@ UNIFIED_SOURCES += [
]
# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True
AllowCompilerWarnings()
FINAL_LIBRARY = 'gkmedias'

Просмотреть файл

@ -63,7 +63,7 @@ SOURCES += [
]
# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True
AllowCompilerWarnings()
FINAL_LIBRARY = 'gkmedias'
LOCAL_INCLUDES += [

Просмотреть файл

@ -68,7 +68,7 @@ SOURCES += [
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'

Просмотреть файл

@ -72,7 +72,7 @@ if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
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'

Просмотреть файл

@ -53,7 +53,7 @@ UNIFIED_SOURCES += [
]
# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True
AllowCompilerWarnings()
FINAL_LIBRARY = 'gkmedias'

Просмотреть файл

@ -66,7 +66,7 @@ UNIFIED_SOURCES += [
]
# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True
AllowCompilerWarnings()
FINAL_LIBRARY = 'gkmedias'

Просмотреть файл

@ -679,7 +679,7 @@ else:
# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True
AllowCompilerWarnings()
FINAL_LIBRARY = 'gkmedias'
LOCAL_INCLUDES += [

Просмотреть файл

@ -16,4 +16,4 @@ LOCAL_INCLUDES += [
]
# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True
AllowCompilerWarnings()

2
ipc/chromium/src/third_party/moz.build поставляемый
Просмотреть файл

@ -58,7 +58,7 @@ if os_solaris:
]
# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True
AllowCompilerWarnings()
Library('libevent')

Просмотреть файл

@ -33,7 +33,7 @@ if CONFIG['FFVPX_ASFLAGS']:
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']:

Просмотреть файл

@ -83,7 +83,7 @@ else:
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'

Просмотреть файл

@ -67,7 +67,7 @@ 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.

Просмотреть файл

@ -89,4 +89,4 @@ 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()

Просмотреть файл

@ -155,7 +155,7 @@ 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'

Просмотреть файл

@ -27,4 +27,4 @@ SOURCES += [
FINAL_LIBRARY = 'gkmedias'
# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True
AllowCompilerWarnings()

Просмотреть файл

@ -11,4 +11,4 @@ UNIFIED_SOURCES += [
FINAL_LIBRARY = 'gkmedias'
# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True
AllowCompilerWarnings()

Просмотреть файл

@ -15,7 +15,7 @@ EXPORTS.opus += [
]
# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True
AllowCompilerWarnings()
FINAL_LIBRARY = 'gkmedias'

Просмотреть файл

@ -63,7 +63,7 @@ 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']

Просмотреть файл

@ -43,7 +43,7 @@ else:
DEFINES['alloca'] = '_alloca'
# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True
AllowCompilerWarnings()
FINAL_LIBRARY = 'lgpllibs'

Просмотреть файл

@ -16,7 +16,7 @@ SOURCES += [
]
# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True
AllowCompilerWarnings()
FINAL_LIBRARY = 'gkmedias'

Просмотреть файл

@ -138,7 +138,7 @@ TEST_DIRS += [
]
# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True
AllowCompilerWarnings()
FINAL_LIBRARY = 'xul'

Просмотреть файл

@ -14,7 +14,7 @@ EXPORTS.theora += [
]
# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True
AllowCompilerWarnings()
FINAL_LIBRARY = 'gkmedias'

Просмотреть файл

@ -32,4 +32,4 @@ LOCAL_INCLUDES += [
]
# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True
AllowCompilerWarnings()

Просмотреть файл

@ -49,7 +49,7 @@ 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'

Просмотреть файл

@ -79,7 +79,7 @@ else:
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'

Просмотреть файл

@ -35,4 +35,4 @@ 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': []}

4
media/mtransport/third_party/moz.build поставляемый
Просмотреть файл

@ -70,13 +70,13 @@ nrappkit_non_unified_sources = [
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

Просмотреть файл

@ -80,6 +80,6 @@ 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'

Просмотреть файл

@ -71,7 +71,7 @@ elif CONFIG['MOZ_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
@ -87,7 +87,7 @@ if CONFIG['MOZ_WEBRTC_SIGNALING']:
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.

Просмотреть файл

@ -9,7 +9,7 @@
# 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

Просмотреть файл

@ -23,7 +23,7 @@ UNIFIED_SOURCES += [
]
# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True
AllowCompilerWarnings()
CFLAGS += ['-DBROTLI_BUILD_PORTABLE']

Просмотреть файл

@ -13,7 +13,7 @@ LOCAL_INCLUDES += [
]
# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True
AllowCompilerWarnings()
# base components
SOURCES += [

Просмотреть файл

@ -557,7 +557,7 @@ USE_LIBS += [
]
# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True
AllowCompilerWarnings()
GeckoSharedLibrary('pdfium', linkage=None)

Просмотреть файл

@ -16,6 +16,6 @@ UNIFIED_SOURCES += [
]
# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True
AllowCompilerWarnings()
Library('woff2')

Просмотреть файл

@ -19,7 +19,7 @@ UNIFIED_SOURCES += [
'src/xz_dec_stream.c',
]
ALLOW_COMPILER_WARNINGS = True
AllowCompilerWarnings()
if CONFIG['TARGET_CPU'].startswith('arm'):
# Accept arm, armv7, etc.

Просмотреть файл

@ -44,7 +44,7 @@ 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'

Просмотреть файл

@ -18,7 +18,7 @@ UNIFIED_SOURCES += [
]
# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True
AllowCompilerWarnings()
FINAL_LIBRARY = 'xul'

Просмотреть файл

@ -1052,15 +1052,6 @@ SUBCONTEXTS = {cls.__name__: cls for cls in SUBCONTEXTS}
# (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.
@ -2411,6 +2402,16 @@ DEPRECATION_HINTS = {
SIMPLE_PROGRAMS += ['foo', 'bar']"
''',
'ALLOW_COMPILER_WARNINGS': '''
Please use
AllowCompilerWarnings()
instead of
ALLOW_COMPILER_WARNINGS = True
''',
'FORCE_SHARED_LIB': '''
Please use

Просмотреть файл

@ -922,7 +922,6 @@ class TreeMetadataEmitter(LoggingMixin):
# 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',

Просмотреть файл

@ -105,9 +105,9 @@ else:
# 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.

Просмотреть файл

@ -239,7 +239,7 @@ SOURCES += [
]
# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True
AllowCompilerWarnings()
FINAL_LIBRARY = 'xul'

Просмотреть файл

@ -31,7 +31,7 @@ if CONFIG['OS_TARGET'] == 'Android':
]
# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True
AllowCompilerWarnings()
FINAL_LIBRARY = 'xul'

Просмотреть файл

@ -12,7 +12,7 @@ UNIFIED_SOURCES += [
]
# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True
AllowCompilerWarnings()
FINAL_LIBRARY = 'xul'

Просмотреть файл

@ -43,7 +43,7 @@ SOURCES += [
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'

Просмотреть файл

@ -65,7 +65,7 @@ if CONFIG['OS_TARGET'] == 'Android':
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'

Просмотреть файл

@ -61,6 +61,6 @@ Library('breakpad_processor')
DisableStlWrapping()
# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True
AllowCompilerWarnings()
include('/toolkit/crashreporter/crashreporter.mozbuild')