Bug 1207030 - Enable -Wshadow flag in more directories that have no -Wshadow warnings. r=glandium
authorChris Peterson <cpeterson@mozilla.com>
Tue, 22 Sep 2015 21:39:03 -0700
changeset 295729 20a95408d007f9e040ca02c87d851fbe625b91e0
parent 295728 9a2e51a7ece292ceea5011159035f8f7bb443b88
child 295730 a729df0cb8b4ab8323890c07516c357d7ce3886e
push id5711
push userdmitchell@mozilla.com
push dateWed, 23 Sep 2015 17:01:23 +0000
reviewersglandium
bugs1207030
milestone44.0a1
Bug 1207030 - Enable -Wshadow flag in more directories that have no -Wshadow warnings. r=glandium
accessible/windows/uia/moz.build
browser/components/about/moz.build
browser/components/build/moz.build
browser/components/dirprovider/moz.build
browser/components/feeds/moz.build
browser/components/shell/moz.build
devtools/server/moz.build
docshell/base/timeline/moz.build
docshell/shistory/moz.build
dom/activities/moz.build
dom/base/test/gtest/moz.build
dom/battery/moz.build
dom/broadcastchannel/moz.build
dom/browser-element/moz.build
dom/cellbroadcast/moz.build
dom/devicestorage/moz.build
dom/encoding/moz.build
dom/filesystem/moz.build
dom/fmradio/ipc/moz.build
dom/fmradio/moz.build
dom/gamepad/moz.build
dom/geolocation/moz.build
dom/icc/moz.build
dom/inputport/moz.build
dom/json/moz.build
dom/jsurl/moz.build
dom/mathml/moz.build
dom/media/android/moz.build
dom/media/gmp-plugin-openh264/moz.build
dom/media/gmp-plugin/moz.build
dom/media/imagecapture/moz.build
dom/messagechannel/moz.build
dom/nfc/moz.build
dom/offline/moz.build
dom/payment/moz.build
dom/permission/moz.build
dom/plugins/base/android/moz.build
dom/power/moz.build
dom/presentation/moz.build
dom/presentation/provider/moz.build
dom/requestsync/moz.build
dom/smil/moz.build
dom/speakermanager/moz.build
dom/storage/moz.build
dom/system/android/moz.build
dom/system/moz.build
dom/system/qt/moz.build
dom/system/windows/moz.build
dom/telephony/moz.build
dom/time/moz.build
dom/tv/moz.build
dom/voicemail/moz.build
dom/vr/moz.build
dom/workers/test/gtest/moz.build
editor/txmgr/moz.build
editor/txtsvc/moz.build
embedding/browser/build/moz.build
embedding/components/appstartup/moz.build
embedding/components/build/moz.build
embedding/components/commandhandler/moz.build
embedding/components/find/moz.build
embedding/components/printingui/ipc/moz.build
embedding/components/printingui/mac/moz.build
embedding/components/printingui/unixshared/moz.build
embedding/components/printingui/win/moz.build
extensions/auth/moz.build
extensions/gio/moz.build
extensions/permissions/moz.build
extensions/pref/autoconfig/src/moz.build
extensions/spellcheck/hunspell/glue/moz.build
extensions/universalchardet/src/base/moz.build
extensions/universalchardet/src/xpcom/moz.build
gfx/gl/moz.build
gfx/ipc/moz.build
gfx/src/moz.build
gfx/vr/moz.build
gfx/ycbcr/moz.build
hal/moz.build
image/build/moz.build
image/decoders/icon/android/moz.build
image/decoders/icon/gtk/moz.build
image/decoders/icon/moz.build
image/decoders/icon/qt/moz.build
image/decoders/icon/win/moz.build
image/encoders/bmp/moz.build
image/encoders/ico/moz.build
image/encoders/jpeg/moz.build
image/encoders/png/moz.build
intl/build/moz.build
intl/chardet/moz.build
intl/locale/moz.build
intl/locale/unix/moz.build
intl/lwbrk/moz.build
intl/unicharutil/tests/moz.build
intl/unicharutil/util/standalone/moz.build
ipc/app/moz.build
ipc/app/pie/moz.build
ipc/contentproc/moz.build
ipc/dbus/moz.build
ipc/hal/moz.build
ipc/ipdl/test/cxx/app/moz.build
ipc/ipdl/test/cxx/moz.build
ipc/netd/moz.build
ipc/nfc/moz.build
ipc/ril/moz.build
ipc/unixfd/moz.build
ipc/unixsocket/moz.build
js/ductwork/debugger/moz.build
js/xpconnect/shell/moz.build
js/xpconnect/tests/components/native/moz.build
layout/printing/moz.build
layout/tools/layout-debug/src/moz.build
media/gmp-clearkey/0.1/gtest/moz.build
media/gmp-clearkey/0.1/moz.build
media/libsoundtouch/src/moz.build
media/libstagefright/gtest/moz.build
memory/fallible/moz.build
memory/mozalloc/moz.build
memory/mozalloc/staticruntime/moz.build
memory/replace/dmd/moz.build
memory/replace/logalloc/moz.build
memory/replace/logalloc/replay/moz.build
memory/replace/replace/moz.build
memory/volatile/moz.build
memory/volatile/tests/moz.build
mobile/android/tests/background/junit4/src/org/mozilla/gecko/fxa/TestSkewHandler.java.orig
mobile/android/tests/background/junit4/src/org/mozilla/gecko/fxa/login/TestFxAccountLoginStateMachine.java.orig
mobile/android/tests/background/junit4/src/org/mozilla/gecko/fxa/login/TestStateFactory.java.orig
modules/libjar/moz.build
modules/libjar/zipwriter/moz.build
modules/libmar/verify/moz.build
modules/libpref/moz.build
mozglue/build/moz.build
mozglue/misc/moz.build
netwerk/streamconv/moz.build
netwerk/system/android/moz.build
netwerk/system/linux/moz.build
netwerk/system/qt/moz.build
rdf/build/moz.build
rdf/datasource/moz.build
rdf/tests/rdfcat/moz.build
rdf/tests/rdfpoll/moz.build
rdf/tests/triplescat/moz.build
toolkit/components/alerts/moz.build
toolkit/components/autocomplete/moz.build
toolkit/components/build/moz.build
toolkit/components/commandlines/moz.build
toolkit/components/ctypes/moz.build
toolkit/components/ctypes/tests/moz.build
toolkit/components/diskspacewatcher/moz.build
toolkit/components/filepicker/moz.build
toolkit/components/finalizationwitness/moz.build
toolkit/components/find/moz.build
toolkit/components/jsdownloads/src/moz.build
toolkit/components/osfile/moz.build
toolkit/components/parentalcontrols/moz.build
toolkit/components/perf/moz.build
toolkit/components/reflect/moz.build
toolkit/components/satchel/moz.build
toolkit/components/startup/moz.build
toolkit/components/statusfilter/moz.build
toolkit/components/terminator/moz.build
toolkit/components/typeaheadfind/moz.build
toolkit/components/workerlz4/moz.build
toolkit/system/androidproxy/moz.build
toolkit/system/gnome/moz.build
toolkit/system/unixproxy/moz.build
uriloader/base/moz.build
widget/android/jni/moz.build
widget/qt/moz.build
widget/uikit/moz.build
widget/xremoteclient/moz.build
xpcom/glue/tests/gtest/moz.build
xpcom/reflect/xptcall/moz.build
xpcom/reflect/xptinfo/moz.build
xpcom/system/moz.build
xpcom/tests/component/moz.build
xpcom/tests/component_no_aslr/moz.build
xulrunner/examples/simple/components/src/moz.build
--- a/accessible/windows/uia/moz.build
+++ b/accessible/windows/uia/moz.build
@@ -13,8 +13,11 @@ LOCAL_INCLUDES += [
     '/accessible/generic',
     '/accessible/html',
     '/accessible/windows/msaa',
     '/accessible/xpcom',
     '/accessible/xul',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/browser/components/about/moz.build
+++ b/browser/components/about/moz.build
@@ -12,8 +12,11 @@ SOURCES += [
     'AboutRedirector.cpp',
 ]
 
 FINAL_LIBRARY = 'browsercomps'
 
 LOCAL_INCLUDES += [
     '../build',
 ]
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/browser/components/build/moz.build
+++ b/browser/components/build/moz.build
@@ -33,8 +33,11 @@ if CONFIG['OS_ARCH'] == 'WINNT':
     DELAYLOAD_DLLS += [
         'esent.dll',
     ]
 
 # Mac: Need to link with CoreFoundation for Mac Migrators (PList reading code)
 # GTK2: Need to link with glib for GNOME shell service
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('cocoa', 'gtk2', 'gtk3'):
     OS_LIBS += CONFIG['TK_LIBS']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/browser/components/dirprovider/moz.build
+++ b/browser/components/dirprovider/moz.build
@@ -16,8 +16,11 @@ XPCSHELL_TESTS_MANIFESTS += [
     'tests/unit/xpcshell.ini',
 ]
 
 FINAL_LIBRARY = 'browsercomps'
 
 LOCAL_INCLUDES += [
     '../build'
 ]
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/browser/components/feeds/moz.build
+++ b/browser/components/feeds/moz.build
@@ -37,8 +37,11 @@ for var in ('MOZ_APP_NAME', 'MOZ_MACBUND
     DEFINES[var] = CONFIG[var]
 
 LOCAL_INCLUDES += [
     '../build',
 ]
 
 with Files('**'):
     BUG_COMPONENT = ('Firefox', 'RSS Discovery and Preview')
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/browser/components/shell/moz.build
+++ b/browser/components/shell/moz.build
@@ -47,8 +47,11 @@ EXTRA_COMPONENTS += [
 
 for var in ('MOZ_APP_NAME', 'MOZ_APP_VERSION'):
     DEFINES[var] = '"%s"' % CONFIG[var]
 
 CXXFLAGS += CONFIG['TK_CFLAGS']
 
 with Files('**'):
     BUG_COMPONENT = ('Firefox', 'Shell Integration')
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/devtools/server/moz.build
+++ b/devtools/server/moz.build
@@ -30,8 +30,11 @@ FINAL_LIBRARY = 'xul'
 DevToolsModules(
     'child.js',
     'content-globals.js',
     'content-server.jsm',
     'main.js',
     'protocol.js',
     'worker.js'
 )
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/docshell/base/timeline/moz.build
+++ b/docshell/base/timeline/moz.build
@@ -30,8 +30,11 @@ UNIFIED_SOURCES += [
     'TimelineMarker.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
     '/docshell/base'
 ]
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/docshell/shistory/moz.build
+++ b/docshell/shistory/moz.build
@@ -27,8 +27,11 @@ UNIFIED_SOURCES += [
     'nsSHTransaction.cpp',
 ]
 
 LOCAL_INCLUDES += [
     '/docshell/base',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['CLANG_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/activities/moz.build
+++ b/dom/activities/moz.build
@@ -33,8 +33,11 @@ EXTRA_JS_MODULES += [
 
 LOCAL_INCLUDES += [
     '/dom/base',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/base/test/gtest/moz.build
+++ b/dom/base/test/gtest/moz.build
@@ -10,8 +10,11 @@ UNIFIED_SOURCES += [
 
 LOCAL_INCLUDES += [
     '/dom/base'
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul-gtest'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/battery/moz.build
+++ b/dom/battery/moz.build
@@ -13,8 +13,11 @@ SOURCES += [
     'BatteryManager.cpp',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 MOCHITEST_MANIFESTS += ['test/mochitest.ini']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/broadcastchannel/moz.build
+++ b/dom/broadcastchannel/moz.build
@@ -24,8 +24,11 @@ LOCAL_INCLUDES += [
 ]
 
 MOCHITEST_MANIFESTS += ['tests/mochitest.ini']
 MOCHITEST_CHROME_MANIFESTS += ['tests/chrome.ini']
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/browser-element/moz.build
+++ b/dom/browser-element/moz.build
@@ -47,8 +47,11 @@ LOCAL_INCLUDES += [
     '/dom/ipc',
 ]
 
 MOCHITEST_MANIFESTS += [
     'mochitest/mochitest-oop.ini',
     'mochitest/mochitest.ini',
     'mochitest/priority/mochitest.ini',
 ]
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/cellbroadcast/moz.build
+++ b/dom/cellbroadcast/moz.build
@@ -31,8 +31,11 @@ EXPORTS.mozilla.dom.cellbroadcast += [
 
 IPDL_SOURCES += [
     'ipc/PCellBroadcast.ipdl',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/devicestorage/moz.build
+++ b/dom/devicestorage/moz.build
@@ -40,8 +40,11 @@ LOCAL_INCLUDES += [
     '/dom/ipc',
 ]
 
 MOCHITEST_MANIFESTS += [
     'ipc/mochitest.ini',
     'test/mochitest.ini',
 ]
 MOCHITEST_CHROME_MANIFESTS += ['test/chrome.ini']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/encoding/moz.build
+++ b/dom/encoding/moz.build
@@ -40,8 +40,11 @@ for prefix in prefixes:
     props.script = props2arrays
     props.inputs = [input_file]
 
 MOCHITEST_MANIFESTS += [
     'test/mochitest.ini',
 ]
 MOCHITEST_CHROME_MANIFESTS += ['test/chrome.ini']
 XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/filesystem/moz.build
+++ b/dom/filesystem/moz.build
@@ -36,8 +36,11 @@ IPDL_SOURCES += [
     'PFileSystemRequest.ipdl',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 LOCAL_INCLUDES += [
     '/dom/base',
 ]
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/fmradio/ipc/moz.build
+++ b/dom/fmradio/ipc/moz.build
@@ -25,8 +25,10 @@ LOCAL_INCLUDES += [
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
     '/dom/fmradio',
 ]
 
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/fmradio/moz.build
+++ b/dom/fmradio/moz.build
@@ -27,8 +27,11 @@ IPDL_SOURCES += [
     'ipc/PFMRadioRequest.ipdl',
 ]
 
 LOCAL_INCLUDES += [
     '../base',
     '../system/gonk',
 ]
 include('/ipc/chromium/chromium-config.mozbuild')
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/gamepad/moz.build
+++ b/dom/gamepad/moz.build
@@ -49,8 +49,11 @@ FINAL_LIBRARY = 'xul'
 LOCAL_INCLUDES += [
     '/dom/base',
 ]
 
 CFLAGS += CONFIG['GLIB_CFLAGS']
 CFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS']
 CXXFLAGS += CONFIG['GLIB_CFLAGS']
 CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/geolocation/moz.build
+++ b/dom/geolocation/moz.build
@@ -46,8 +46,11 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'go
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     LOCAL_INCLUDES += [
         '/dom/system/mac',
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     LOCAL_INCLUDES += [
         '/dom/system/windows',
     ]
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/icc/moz.build
+++ b/dom/icc/moz.build
@@ -50,8 +50,11 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
     '/dom/system/gonk',
 ]
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/inputport/moz.build
+++ b/dom/inputport/moz.build
@@ -39,8 +39,11 @@ XPIDL_MODULE = 'dom_inputport'
 
 MOCHITEST_MANIFESTS += ['test/mochitest/mochitest.ini']
 
 XPCSHELL_TESTS_MANIFESTS += ['test/xpcshell/xpcshell.ini']
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/json/moz.build
+++ b/dom/json/moz.build
@@ -15,8 +15,11 @@ UNIFIED_SOURCES += [
 LOCAL_INCLUDES += [
     '/dom/base',
 ]
 
 FINAL_LIBRARY = 'xul'
 
 XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini']
 MOCHITEST_MANIFESTS += ['test/mochitest.ini']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/jsurl/moz.build
+++ b/dom/jsurl/moz.build
@@ -17,8 +17,11 @@ LOCAL_INCLUDES += [
     "/netwerk/base",
 ]
 
 FINAL_LIBRARY = 'xul'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 MOCHITEST_MANIFESTS += ['test/mochitest.ini']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/mathml/moz.build
+++ b/dom/mathml/moz.build
@@ -11,8 +11,10 @@ UNIFIED_SOURCES += [
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 LOCAL_INCLUDES += [
     '/dom/base',
 ]
 
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/media/android/moz.build
+++ b/dom/media/android/moz.build
@@ -20,8 +20,11 @@ UNIFIED_SOURCES += [
 ]
 
 LOCAL_INCLUDES += [
     '/dom/base',
     '/dom/html',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/media/gmp-plugin-openh264/moz.build
+++ b/dom/media/gmp-plugin-openh264/moz.build
@@ -17,8 +17,11 @@ if CONFIG['OS_ARCH'] == 'WINNT':
     OS_LIBS += [
         'ole32',
     ]
 
 USE_STATIC_LIBS = True
 NO_VISIBILITY_FLAGS = True
 # Don't use STL wrappers; this isn't Gecko code
 DISABLE_STL_WRAPPING = True
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/media/gmp-plugin/moz.build
+++ b/dom/media/gmp-plugin/moz.build
@@ -19,8 +19,11 @@ if CONFIG['OS_ARCH'] == 'WINNT':
     OS_LIBS += [
         'ole32',
     ]
 
 USE_STATIC_LIBS = True
 NO_VISIBILITY_FLAGS = True
 # Don't use STL wrappers; this isn't Gecko code
 DISABLE_STL_WRAPPING = True
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/media/imagecapture/moz.build
+++ b/dom/media/imagecapture/moz.build
@@ -9,8 +9,11 @@ EXPORTS.mozilla.dom += [
 ]
 
 UNIFIED_SOURCES += [
     'CaptureTask.cpp',
     'ImageCapture.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/messagechannel/moz.build
+++ b/dom/messagechannel/moz.build
@@ -32,8 +32,11 @@ LOCAL_INCLUDES += [
     '../base',
     '../events',
     '../workers',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/nfc/moz.build
+++ b/dom/nfc/moz.build
@@ -46,8 +46,11 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk
     ]
     XPCSHELL_TESTS_MANIFESTS += [
         'tests/unit/xpcshell.ini'
     ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/offline/moz.build
+++ b/dom/offline/moz.build
@@ -11,8 +11,11 @@ UNIFIED_SOURCES += [
     'nsDOMOfflineResourceList.cpp',
 ]
 
 LOCAL_INCLUDES += [
     '/dom/base',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/payment/moz.build
+++ b/dom/payment/moz.build
@@ -32,8 +32,11 @@ FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
     '/dom/base'
 ]
 
 XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
 
 MOCHITEST_MANIFESTS += ['tests/mochitest/mochitest.ini']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/permission/moz.build
+++ b/dom/permission/moz.build
@@ -42,8 +42,11 @@ if CONFIG['MOZ_B2G_BT']:
 
 if CONFIG['MOZ_WEBSMS_BACKEND']:
     MOCHITEST_MANIFESTS += ['tests/mochitest-websms.ini']
 
 if CONFIG['MOZ_TIME_MANAGER']:
     MOCHITEST_MANIFESTS += ['tests/mochitest-time.ini']
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/plugins/base/android/moz.build
+++ b/dom/plugins/base/android/moz.build
@@ -31,8 +31,11 @@ LOCAL_INCLUDES += [
     '/gfx/gl',
     '/widget',
     '/widget/android',
 ]
 
 DEFINES['MOZ_APP_NAME'] = '"%s"' % CONFIG['MOZ_APP_NAME']
 
 CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/power/moz.build
+++ b/dom/power/moz.build
@@ -28,8 +28,11 @@ UNIFIED_SOURCES += [
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 MOCHITEST_MANIFESTS += ['test/mochitest.ini']
 BROWSER_CHROME_MANIFESTS += ['test/browser.ini']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/presentation/moz.build
+++ b/dom/presentation/moz.build
@@ -52,8 +52,11 @@ EXTRA_JS_MODULES += [
 IPDL_SOURCES += [
     'ipc/PPresentation.ipdl',
     'ipc/PPresentationRequest.ipdl'
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/presentation/provider/moz.build
+++ b/dom/presentation/provider/moz.build
@@ -11,8 +11,11 @@ EXTRA_COMPONENTS += [
 
 UNIFIED_SOURCES += [
     'MulticastDNSDeviceProvider.cpp',
     'PresentationDeviceProviderModule.cpp',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/requestsync/moz.build
+++ b/dom/requestsync/moz.build
@@ -24,8 +24,11 @@ EXTRA_JS_MODULES += [
 
 SOURCES += [
     'RequestSyncWifiService.cpp',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/smil/moz.build
+++ b/dom/smil/moz.build
@@ -65,8 +65,11 @@ UNIFIED_SOURCES += [
 LOCAL_INCLUDES += [
     '/dom/base',
     '/dom/svg',
     '/layout/base',
     '/layout/style',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/speakermanager/moz.build
+++ b/dom/speakermanager/moz.build
@@ -16,8 +16,11 @@ UNIFIED_SOURCES += [
     'SpeakerManager.cpp',
     'SpeakerManagerService.cpp',
     'SpeakerManagerServiceChild.cpp',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/storage/moz.build
+++ b/dom/storage/moz.build
@@ -26,8 +26,11 @@ include('/ipc/chromium/chromium-config.m
 
 FINAL_LIBRARY = 'xul'
 LOCAL_INCLUDES += [
     '/dom/base',
 ]
 
 if CONFIG['ENABLE_TESTS']:
     DEFINES['DOM_STORAGE_TESTS'] = True
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/system/android/moz.build
+++ b/dom/system/android/moz.build
@@ -11,8 +11,10 @@ SOURCES += [
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 LOCAL_INCLUDES += [
     '/dom/geolocation',
 ]
 
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/system/moz.build
+++ b/dom/system/moz.build
@@ -58,8 +58,11 @@ LOCAL_INCLUDES += [
     '/js/xpconnect/loader',
 ]
 
 DEFINES['DLL_PREFIX'] = '"%s"' % CONFIG['DLL_PREFIX']
 DEFINES['DLL_SUFFIX'] = '"%s"' % CONFIG['DLL_SUFFIX']
 
 MOCHITEST_CHROME_MANIFESTS += ['tests/chrome.ini']
 MOCHITEST_MANIFESTS += ['tests/mochitest.ini']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/system/qt/moz.build
+++ b/dom/system/qt/moz.build
@@ -19,8 +19,11 @@ if CONFIG['MOZ_ENABLE_QT5GEOPOSITION']:
 if CONFIG['MOZ_ENABLE_QT5FEEDBACK']:
     SOURCES += [
         'QtHapticFeedback.cpp',
     ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/system/windows/moz.build
+++ b/dom/system/windows/moz.build
@@ -9,8 +9,11 @@ SOURCES += [
     'WindowsLocationProvider.cpp'
 ]
 
 LOCAL_INCLUDES += [
     '/dom/geolocation'
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/telephony/moz.build
+++ b/dom/telephony/moz.build
@@ -74,8 +74,11 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk
     EXTRA_JS_MODULES += [
         'gonk/DialNumberUtils.jsm',
         'gonk/TelephonyUtils.jsm',
     ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/time/moz.build
+++ b/dom/time/moz.build
@@ -22,8 +22,11 @@ UNIFIED_SOURCES += [
     'TimeChangeObserver.cpp',
     'TimeManager.cpp',
     'TimeService.cpp',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/tv/moz.build
+++ b/dom/tv/moz.build
@@ -40,8 +40,11 @@ XPIDL_MODULE = 'dom_tv'
 
 MOCHITEST_MANIFESTS += ['test/mochitest/mochitest.ini']
 
 XPCSHELL_TESTS_MANIFESTS += ['test/xpcshell/xpcshell.ini']
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/voicemail/moz.build
+++ b/dom/voicemail/moz.build
@@ -46,8 +46,11 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk
 
 LOCAL_INCLUDES += [
     '../base',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/vr/moz.build
+++ b/dom/vr/moz.build
@@ -13,8 +13,11 @@ UNIFIED_SOURCES = [
     ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 LOCAL_INCLUDES += [
     '/dom/base'
 ]
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/dom/workers/test/gtest/moz.build
+++ b/dom/workers/test/gtest/moz.build
@@ -6,8 +6,11 @@
 
 UNIFIED_SOURCES = [
     'TestReadWrite.cpp',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul-gtest'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/editor/txmgr/moz.build
+++ b/editor/txmgr/moz.build
@@ -23,8 +23,11 @@ UNIFIED_SOURCES += [
     'nsTransactionItem.cpp',
     'nsTransactionList.cpp',
     'nsTransactionManager.cpp',
     'nsTransactionManagerFactory.cpp',
     'nsTransactionStack.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/editor/txtsvc/moz.build
+++ b/editor/txtsvc/moz.build
@@ -19,8 +19,11 @@ EXPORTS += [
 ]
 
 UNIFIED_SOURCES += [
     'nsFilteredContentIterator.cpp',
     'nsTextServicesDocument.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/embedding/browser/build/moz.build
+++ b/embedding/browser/build/moz.build
@@ -8,8 +8,10 @@ SOURCES += [
     'nsWebBrowserModule.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
 LOCAL_INCLUDES += [
     '..',
 ]
 
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/embedding/components/appstartup/moz.build
+++ b/embedding/components/appstartup/moz.build
@@ -8,8 +8,11 @@ EXPORTS += [
     'nsIAppStartupNotifier.h',
 ]
 
 SOURCES += [
     'nsAppStartupNotifier.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/embedding/components/build/moz.build
+++ b/embedding/components/build/moz.build
@@ -32,8 +32,10 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co
 if CONFIG['MOZ_PDF_PRINTING']:
     DEFINES['PROXY_PRINTING'] = 1
     LOCAL_INCLUDES += [
         '../printingui/unixshared',
     ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/embedding/components/commandhandler/moz.build
+++ b/embedding/components/commandhandler/moz.build
@@ -19,8 +19,11 @@ UNIFIED_SOURCES += [
     'nsBaseCommandController.cpp',
     'nsCommandGroup.cpp',
     'nsCommandManager.cpp',
     'nsCommandParams.cpp',
     'nsControllerCommandTable.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/embedding/components/find/moz.build
+++ b/embedding/components/find/moz.build
@@ -12,8 +12,11 @@ XPIDL_SOURCES += [
 XPIDL_MODULE = 'find'
 
 UNIFIED_SOURCES += [
     'nsFind.cpp',
     'nsWebBrowserFind.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/embedding/components/printingui/ipc/moz.build
+++ b/embedding/components/printingui/ipc/moz.build
@@ -28,8 +28,11 @@ IPDL_SOURCES += [
     'PPrintingTypes.ipdlh',
     'PPrintProgressDialog.ipdl',
     'PPrintSettingsDialog.ipdl',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/embedding/components/printingui/mac/moz.build
+++ b/embedding/components/printingui/mac/moz.build
@@ -9,8 +9,11 @@ UNIFIED_SOURCES += [
     'nsPrintProgressParams.cpp',
 ]
 
 SOURCES += [
     'nsPrintingPromptServiceX.mm',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/embedding/components/printingui/unixshared/moz.build
+++ b/embedding/components/printingui/unixshared/moz.build
@@ -6,8 +6,11 @@
 
 UNIFIED_SOURCES += [
     'nsPrintingPromptService.cpp',
     'nsPrintProgress.cpp',
     'nsPrintProgressParams.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/embedding/components/printingui/win/moz.build
+++ b/embedding/components/printingui/win/moz.build
@@ -11,8 +11,11 @@ UNIFIED_SOURCES += [
     'nsPrintProgressParams.cpp',
 ]
 
 EXPORTS += [
     'nsPrintDialogUtil.h',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/extensions/auth/moz.build
+++ b/extensions/auth/moz.build
@@ -20,8 +20,11 @@ if CONFIG['OS_ARCH'] == 'WINNT':
     ]
     DEFINES['USE_SSPI'] = True
 else:
     UNIFIED_SOURCES += [
         'nsAuthSambaNTLM.cpp',
     ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/extensions/gio/moz.build
+++ b/extensions/gio/moz.build
@@ -6,8 +6,11 @@
 
 SOURCES += [
     'nsGIOProtocolHandler.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
 
 CXXFLAGS += CONFIG['MOZ_GIO_CFLAGS']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/extensions/permissions/moz.build
+++ b/extensions/permissions/moz.build
@@ -5,8 +5,11 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 UNIFIED_SOURCES += [
     'nsContentBlocker.cpp',
     'nsModuleFactory.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/extensions/pref/autoconfig/src/moz.build
+++ b/extensions/pref/autoconfig/src/moz.build
@@ -7,8 +7,11 @@
 UNIFIED_SOURCES += [
     'nsAutoConfig.cpp',
     'nsConfigFactory.cpp',
     'nsJSConfigTriggers.cpp',
     'nsReadConfig.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/extensions/spellcheck/hunspell/glue/moz.build
+++ b/extensions/spellcheck/hunspell/glue/moz.build
@@ -28,8 +28,10 @@ IPDL_SOURCES = [
     'PRemoteSpellcheckEngine.ipdl',
 ]
 
 EXPORTS.mozilla += [
      'RemoteSpellCheckEngineChild.h',
      'RemoteSpellCheckEngineParent.h',
 ]
 
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/extensions/universalchardet/src/base/moz.build
+++ b/extensions/universalchardet/src/base/moz.build
@@ -15,8 +15,11 @@ UNIFIED_SOURCES += [
     'nsMBCSGroupProber.cpp',
     'nsMBCSSM.cpp',
     'nsSJISProber.cpp',
     'nsUniversalDetector.cpp',
     'nsUTF8Prober.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/extensions/universalchardet/src/xpcom/moz.build
+++ b/extensions/universalchardet/src/xpcom/moz.build
@@ -9,8 +9,11 @@ UNIFIED_SOURCES += [
     'nsUniversalCharDetModule.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
     '../base',
 ]
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/gfx/gl/moz.build
+++ b/gfx/gl/moz.build
@@ -157,8 +157,11 @@ CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
 CXXFLAGS += CONFIG['TK_CFLAGS']
 CFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
 CFLAGS += CONFIG['TK_CFLAGS']
 
 LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES']
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     del DEFINES['UNICODE']
+
+if CONFIG['CLANG_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/gfx/ipc/moz.build
+++ b/gfx/ipc/moz.build
@@ -31,8 +31,11 @@ IPDL_SOURCES = [
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
 CXXFLAGS += CONFIG['TK_CFLAGS']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/gfx/src/moz.build
+++ b/gfx/src/moz.build
@@ -85,8 +85,11 @@ FINAL_LIBRARY = 'xul'
 CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
 CXXFLAGS += CONFIG['TK_CFLAGS']
 
 if CONFIG['MOZ_WIDGET_GTK']:
     CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS']
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt':
     CXXFLAGS += CONFIG['MOZ_QT_CFLAGS']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/gfx/vr/moz.build
+++ b/gfx/vr/moz.build
@@ -36,8 +36,10 @@ CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
 CXXFLAGS += CONFIG['TK_CFLAGS']
 CFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
 CFLAGS += CONFIG['TK_CFLAGS']
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/gfx/ycbcr/moz.build
+++ b/gfx/ycbcr/moz.build
@@ -59,8 +59,11 @@ if CONFIG['CPU_ARCH'] == 'arm' and CONFI
     SOURCES += [
         'yuv_row_arm.s',
     ]
     SOURCES += [
         'yuv_convert_arm.cpp',
     ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/hal/moz.build
+++ b/hal/moz.build
@@ -172,8 +172,11 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
     CXXFLAGS += ['-I%s/hardware/libhardware_legacy/include' % CONFIG['ANDROID_SOURCE']]
 
 CFLAGS += CONFIG['GLIB_CFLAGS']
 CFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS']
 CXXFLAGS += CONFIG['GLIB_CFLAGS']
 CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/image/build/moz.build
+++ b/image/build/moz.build
@@ -16,8 +16,10 @@ FINAL_LIBRARY = 'xul'
 LOCAL_INCLUDES += [
     '/image',
     '/image/encoders/bmp',
     '/image/encoders/ico',
     '/image/encoders/jpeg',
     '/image/encoders/png',
 ]
 
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/image/decoders/icon/android/moz.build
+++ b/image/decoders/icon/android/moz.build
@@ -6,8 +6,11 @@
 
 SOURCES += [
     'nsIconChannel.cpp',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/image/decoders/icon/gtk/moz.build
+++ b/image/decoders/icon/gtk/moz.build
@@ -9,8 +9,11 @@ SOURCES += [
 ]
 
 FINAL_LIBRARY = 'xul'
 
 if CONFIG['MOZ_ENABLE_GNOMEUI']:
     CXXFLAGS += CONFIG['MOZ_GNOMEUI_CFLAGS']
 else:
     CXXFLAGS += CONFIG['TK_CFLAGS']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/image/decoders/icon/moz.build
+++ b/image/decoders/icon/moz.build
@@ -28,8 +28,11 @@ if CONFIG['OS_ARCH'] == 'WINNT':
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     platform = 'mac'
 
 if CONFIG['OS_TARGET'] == 'Android':
     platform = 'android'
 
 if platform:
     LOCAL_INCLUDES += [platform]
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/image/decoders/icon/qt/moz.build
+++ b/image/decoders/icon/qt/moz.build
@@ -20,8 +20,11 @@ EXTRA_COMPONENTS += [
 
 EXTRA_PP_COMPONENTS += [
     'gtkqticonsconverter.js',
 ]
 
 FINAL_LIBRARY = 'xul'
 
 CXXFLAGS += CONFIG['MOZ_QT_CFLAGS']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/image/decoders/icon/win/moz.build
+++ b/image/decoders/icon/win/moz.build
@@ -4,8 +4,11 @@
 # 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/.
 
 SOURCES += [
     'nsIconChannel.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/image/encoders/bmp/moz.build
+++ b/image/encoders/bmp/moz.build
@@ -8,8 +8,11 @@ SOURCES += [
     'nsBMPEncoder.cpp',
 ]
 
 LOCAL_INCLUDES += [
     '/image',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/image/encoders/ico/moz.build
+++ b/image/encoders/ico/moz.build
@@ -11,8 +11,11 @@ SOURCES += [
 # Decoders need RasterImage.h
 LOCAL_INCLUDES += [
     '/image',
     '/image/encoders/bmp',
     '/image/encoders/png',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/image/encoders/jpeg/moz.build
+++ b/image/encoders/jpeg/moz.build
@@ -4,8 +4,11 @@
 # 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/.
 
 SOURCES += [
     'nsJPEGEncoder.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/image/encoders/png/moz.build
+++ b/image/encoders/png/moz.build
@@ -8,8 +8,11 @@ SOURCES += [
     'nsPNGEncoder.cpp',
 ]
 
 LOCAL_INCLUDES += [
     '/image',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/intl/build/moz.build
+++ b/intl/build/moz.build
@@ -13,8 +13,10 @@ CXXFLAGS += CONFIG['MOZ_ICU_CFLAGS']
 LOCAL_INCLUDES += [
     '../locale',
     '../lwbrk',
     '../strres',
     '../uconv',
     '../unicharutil',
 ]
 
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/intl/chardet/moz.build
+++ b/intl/chardet/moz.build
@@ -12,8 +12,11 @@ EXPORTS += [
 ]
 
 UNIFIED_SOURCES += [
     'nsChardetModule.cpp',
     'nsCyrillicDetector.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/intl/locale/moz.build
+++ b/intl/locale/moz.build
@@ -63,8 +63,11 @@ GENERATED_FILES += [
     'langGroups.properties.h',
 ]
 langgroups = GENERATED_FILES['langGroups.properties.h']
 langgroups.script = 'props2arrays.py'
 langgroups.inputs = ['langGroups.properties']
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt':
     CXXFLAGS += CONFIG['MOZ_QT_CFLAGS']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/intl/locale/unix/moz.build
+++ b/intl/locale/unix/moz.build
@@ -35,8 +35,11 @@ LOCAL_INCLUDES += [
 
 # CODESET is not automatically defined on some older versions of Redhat.
 # Define _XOPEN_SOURCE so CODESET will get defined and thus allow
 # nl_langinfo(CODESET) to compile on these systems.
 if CONFIG['OS_ARCH'] == 'Linux':
     DEFINES['_XOPEN_SOURCE'] = 500
 
 DEFINES['OSTYPE'] = '"%s"' % CONFIG['OS_CONFIG']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/intl/lwbrk/moz.build
+++ b/intl/lwbrk/moz.build
@@ -43,8 +43,11 @@ else:
     SOURCES += [
         'rulebrk.c',
     ]
 
 FINAL_LIBRARY = 'xul'
 
 if CONFIG['MOZ_WIDGET_GTK']:
     CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/intl/unicharutil/tests/moz.build
+++ b/intl/unicharutil/tests/moz.build
@@ -4,8 +4,11 @@
 # 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/.
 
 SOURCES += [
     'NormalizationTest.cpp',
 ]
 
 FINAL_LIBRARY = 'xul-gtest'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/intl/unicharutil/util/standalone/moz.build
+++ b/intl/unicharutil/util/standalone/moz.build
@@ -13,8 +13,11 @@ UNIFIED_SOURCES += [
 
 if CONFIG['ENABLE_INTL_API']:
     CXXFLAGS += CONFIG['MOZ_ICU_CFLAGS']
     USE_LIBS += ['icu']
 
 for var in ('MOZILLA_INTERNAL_API', 'MOZILLA_XPCOMRT_API', 'MOZILLA_EXTERNAL_LINKAGE',
             'NR_SOCKET_IS_VOID_PTR', 'HAVE_STRDUP'):
     DEFINES[var] = True
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/ipc/app/moz.build
+++ b/ipc/app/moz.build
@@ -113,8 +113,11 @@ LDFLAGS += [CONFIG['MOZ_ALLOW_HEAP_EXECU
 if CONFIG['OS_ARCH'] == 'WINNT' and not CONFIG['GNU_CC']:
     LDFLAGS += ['/HEAP:0x40000']
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
     OS_LIBS += [
         'binder',
         'utils',
     ]
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/ipc/app/pie/moz.build
+++ b/ipc/app/pie/moz.build
@@ -23,8 +23,11 @@ if CONFIG['MOZ_SANDBOX']:
 
     # gcc lto likes to put the top level asm in syscall.cc in a different partition
     # from the function using it which breaks the build.  Work around that by
     # forcing there to be only one partition.
     if '-flto' in CONFIG['OS_CXXFLAGS'] and not CONFIG['CLANG_CXX']:
 	LDFLAGS += ['--param lto-partitions=1']
 
 LDFLAGS += ['-pie']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/ipc/contentproc/moz.build
+++ b/ipc/contentproc/moz.build
@@ -21,8 +21,11 @@ if CONFIG['OS_ARCH'] == 'WINNT':
     ]
 
 
 if CONFIG['MOZ_SANDBOX'] and CONFIG['OS_ARCH'] == 'WINNT':
     LOCAL_INCLUDES += [
         '/security/sandbox/chromium',
         '/security/sandbox/chromium-shim',
     ]
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/ipc/dbus/moz.build
+++ b/ipc/dbus/moz.build
@@ -18,8 +18,11 @@ include('/ipc/chromium/chromium-config.m
 
 FINAL_LIBRARY = 'xul'
 
 if CONFIG['MOZ_ENABLE_DBUS']:
     CFLAGS += CONFIG['MOZ_DBUS_CFLAGS']
     CFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS']
     CXXFLAGS += CONFIG['MOZ_DBUS_CFLAGS']
     CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/ipc/hal/moz.build
+++ b/ipc/hal/moz.build
@@ -20,8 +20,11 @@ UNIFIED_SOURCES += [
     'DaemonSocketConsumer.cpp',
     'DaemonSocketPDU.cpp',
     'DaemonSocketPDUHelpers.cpp'
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/ipc/ipdl/test/cxx/app/moz.build
+++ b/ipc/ipdl/test/cxx/app/moz.build
@@ -13,8 +13,11 @@ include('/ipc/chromium/chromium-config.m
 
 LOCAL_INCLUDES += [
     '/toolkit/xre',
     '/xpcom/base',
 ]
 
 if CONFIG['_MSC_VER']:
     WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/ipc/ipdl/test/cxx/moz.build
+++ b/ipc/ipdl/test/cxx/moz.build
@@ -123,8 +123,11 @@ IPDL_SOURCES += [
     'PTestSysVShmem.ipdl',
     'PTestUrgency.ipdl',
     'PTestUrgentHangs.ipdl',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/ipc/netd/moz.build
+++ b/ipc/netd/moz.build
@@ -10,8 +10,11 @@ EXPORTS.mozilla.ipc += [
 
 SOURCES += [
     'Netd.cpp',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/ipc/nfc/moz.build
+++ b/ipc/nfc/moz.build
@@ -9,8 +9,11 @@ if CONFIG['MOZ_NFC']:
     ]
     SOURCES += [
         'NfcConnector.cpp',
     ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/ipc/ril/moz.build
+++ b/ipc/ril/moz.build
@@ -15,8 +15,11 @@ SOURCES += [
     'RilConnector.cpp',
     'RilSocket.cpp',
     'RilSocketConsumer.cpp'
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/ipc/unixfd/moz.build
+++ b/ipc/unixfd/moz.build
@@ -14,8 +14,11 @@ SOURCES += [
     'UnixFdWatcher.cpp',
     'UnixFileWatcher.cpp',
     'UnixSocketWatcher.cpp'
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/ipc/unixsocket/moz.build
+++ b/ipc/unixsocket/moz.build
@@ -24,8 +24,11 @@ SOURCES += [
     'StreamSocket.cpp',
     'StreamSocketConsumer.cpp',
     'UnixSocketConnector.cpp'
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/js/ductwork/debugger/moz.build
+++ b/js/ductwork/debugger/moz.build
@@ -16,8 +16,11 @@ SOURCES += [
     'JSDebugger.cpp',
 ]
 
 EXTRA_JS_MODULES += [
     'jsdebugger.jsm',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/js/xpconnect/shell/moz.build
+++ b/js/xpconnect/shell/moz.build
@@ -30,8 +30,11 @@ if CONFIG['_MSC_VER']:
     WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     RCINCLUDE = 'xpcshell.rc'
 
 CFLAGS += CONFIG['TK_CFLAGS']
 CXXFLAGS += CONFIG['TK_CFLAGS']
 OS_LIBS += CONFIG['TK_LIBS']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/js/xpconnect/tests/components/native/moz.build
+++ b/js/xpconnect/tests/components/native/moz.build
@@ -15,8 +15,11 @@ UNIFIED_SOURCES += [
 
 XPCOMBinaryComponent('xpctest')
 
 DEFINES['LIBRARY_FILENAME'] = '%s%s%s' % (
     CONFIG['DLL_PREFIX'],
     LIBRARY_NAME,
     CONFIG['DLL_SUFFIX']
 )
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/layout/printing/moz.build
+++ b/layout/printing/moz.build
@@ -21,8 +21,10 @@ UNIFIED_SOURCES += [
 ]
 
 FINAL_LIBRARY = 'xul'
 LOCAL_INCLUDES += [
     '../base',
     '/dom/base',
 ]
 
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/layout/tools/layout-debug/src/moz.build
+++ b/layout/tools/layout-debug/src/moz.build
@@ -18,8 +18,11 @@ EXPORTS += [
 UNIFIED_SOURCES += [
     'nsDebugFactory.cpp',
     'nsLayoutDebugCLH.cpp',
     'nsLayoutDebuggingTools.cpp',
     'nsRegressionTester.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/media/gmp-clearkey/0.1/gtest/moz.build
+++ b/media/gmp-clearkey/0.1/gtest/moz.build
@@ -8,8 +8,11 @@ UNIFIED_SOURCES += [
     'TestClearKeyUtils.cpp',
 ]
 
 FINAL_LIBRARY = 'xul-gtest'
 
 LOCAL_INCLUDES += [
     '..',
 ]
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/media/gmp-clearkey/0.1/moz.build
+++ b/media/gmp-clearkey/0.1/moz.build
@@ -52,16 +52,19 @@ LOCAL_INCLUDES += [
     '/dom/media/gmp',
 ]
 
 USE_STATIC_LIBS = True
 
 DISABLE_STL_WRAPPING = True
 DEFINES['MOZ_NO_MOZALLOC'] = True
 
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
+
 # Suppress warnings in third-party code.
 if CONFIG['GNU_CXX']:
     CFLAGS += [
         '-Wno-missing-braces',
         '-Wno-pointer-to-int-cast',
         '-Wno-sign-compare',
         '-include stdio.h',         # for sprintf() prototype
         '-include unistd.h',        # for getpid() prototype
--- a/media/libsoundtouch/src/moz.build
+++ b/media/libsoundtouch/src/moz.build
@@ -39,12 +39,15 @@ if CONFIG['OS_ARCH'] != 'WINNT':
     # header.
     CXXFLAGS += ['-include', 'soundtouch_perms.h']
 else:
     # Windows need alloca renamed to _alloca
     DEFINES['alloca'] = '_alloca'
 
 ALLOW_COMPILER_WARNINGS = True
 
+if CONFIG['CLANG_CXX']:
+    CXXFLAGS += ['-Wshadow']
+
 FINAL_LIBRARY = 'lgpllibs'
 
 # Use abort() instead of exception in SoundTouch.
 DEFINES['ST_NO_EXCEPTION_HANDLING'] = 1
--- a/media/libstagefright/gtest/moz.build
+++ b/media/libstagefright/gtest/moz.build
@@ -13,8 +13,11 @@ SOURCES += [
 
 if CONFIG['MOZ_RUST']:
     UNIFIED_SOURCES += ['TestMP4Rust.cpp',]
     TEST_HARNESS_FILES.gtest += [
         '../../../dom/media/test/street.mp4',
     ]
 
 FINAL_LIBRARY = 'xul-gtest'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/memory/fallible/moz.build
+++ b/memory/fallible/moz.build
@@ -28,8 +28,11 @@ if CONFIG['_MSC_VER']:
     CXXFLAGS += [
         '-Zl',
     ]
 
     if CONFIG['_MSC_VER'] >= '1900':
         # This further prevents the CRT name from getting into the .obj file,
         # by avoiding pulling in a bunch of string code that uses the CRT.
         DEFINES['mozilla_Char16_h'] = True
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/memory/mozalloc/moz.build
+++ b/memory/mozalloc/moz.build
@@ -43,8 +43,11 @@ DISABLE_STL_WRAPPING = True
 DEFINES['IMPL_MFBT'] = True
 
 if CONFIG['_MSC_VER']:
     DIRS += ['staticruntime']
 
 LOCAL_INCLUDES += ['/memory/build']
 
 DIST_INSTALL = True
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/memory/mozalloc/staticruntime/moz.build
+++ b/memory/mozalloc/staticruntime/moz.build
@@ -23,8 +23,11 @@ GENERATED_INCLUDES += ['/xpcom']
 
 DISABLE_STL_WRAPPING = True
 
 DEFINES['IMPL_MFBT'] = True
 
 USE_STATIC_LIBS = True
 
 Library('mozalloc_staticruntime')
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/memory/replace/dmd/moz.build
+++ b/memory/replace/dmd/moz.build
@@ -32,8 +32,10 @@ DISABLE_STL_WRAPPING = True
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     OS_LIBS += [
         'dbghelp',
     ]
 
 TEST_DIRS += ['test']
 
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/memory/replace/logalloc/moz.build
+++ b/memory/replace/logalloc/moz.build
@@ -33,8 +33,11 @@ include('/ipc/chromium/chromium-config.m
 if CONFIG['OS_TARGET'] == 'Android':
     USE_LIBS += [
         'mozglue',
     ]
 
 DIRS += [
     'replay',
 ]
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/memory/replace/logalloc/replay/moz.build
+++ b/memory/replace/logalloc/replay/moz.build
@@ -16,8 +16,11 @@ LOCAL_INCLUDES += [
 ]
 
 # Link replace-malloc and the default allocator.
 USE_LIBS += [
     'memory',
 ]
 
 DISABLE_STL_WRAPPING = True
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/memory/replace/replace/moz.build
+++ b/memory/replace/replace/moz.build
@@ -6,8 +6,11 @@
 
 SharedLibrary('replace_malloc')
 
 SOURCES += [
     'ReplaceMalloc.cpp',
 ]
 
 DISABLE_STL_WRAPPING = True
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/memory/volatile/moz.build
+++ b/memory/volatile/moz.build
@@ -24,8 +24,11 @@ elif CONFIG['OS_TARGET'] == 'WINNT':
 else:
     UNIFIED_SOURCES += [
         'VolatileBufferFallback.cpp',
     ]
 
 FINAL_LIBRARY = 'xul'
 
 TEST_DIRS += ['tests']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/memory/volatile/tests/moz.build
+++ b/memory/volatile/tests/moz.build
@@ -4,8 +4,11 @@
 # 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/.
 
 UNIFIED_SOURCES = [
     'TestVolatileBuffer.cpp',
 ]
 
 FINAL_LIBRARY = 'xul-gtest'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
deleted file mode 100644
--- a/mobile/android/tests/background/junit4/src/org/mozilla/gecko/fxa/TestSkewHandler.java.orig
+++ /dev/null
@@ -1,67 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * 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/. */
-
-package org.mozilla.gecko.fxa;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-import org.mozilla.gecko.background.fxa.SkewHandler;
-import org.mozilla.gecko.sync.net.BaseResource;
-
-import ch.boye.httpclientandroidlib.impl.cookie.DateUtils;
-
-public class TestSkewHandler {
-  public TestSkewHandler() {
-  }
-
-  @Test
-  public void testSkewUpdating() throws Throwable {
-    SkewHandler h = new SkewHandler("foo.com");
-    assertEquals(0L, h.getSkewInSeconds());
-    assertEquals(0L, h.getSkewInMillis());
-
-    long server = 1390101197865L;
-    long local = server - 4500L;
-    h.updateSkewFromServerMillis(server, local);
-    assertEquals(4500L, h.getSkewInMillis());
-    assertEquals(4L, h.getSkewInSeconds());
-
-    local = server;
-    h.updateSkewFromServerMillis(server, local);
-    assertEquals(0L, h.getSkewInMillis());
-    assertEquals(0L, h.getSkewInSeconds());
-
-    local = server + 500L;
-    h.updateSkewFromServerMillis(server, local);
-    assertEquals(-500L, h.getSkewInMillis());
-    assertEquals(0L, h.getSkewInSeconds());
-
-    String date = "Sat, 18 Jan 2014 19:16:52 PST";
-    long dateInMillis = 1390101412000L;              // Obviously this can differ somewhat due to precision.
-    long parsed = DateUtils.parseDate(date).getTime();
-    assertEquals(parsed, dateInMillis);
-
-    h.updateSkewFromHTTPDateString(date, dateInMillis);
-    assertEquals(0L, h.getSkewInMillis());
-    assertEquals(0L, h.getSkewInSeconds());
-
-    h.updateSkewFromHTTPDateString(date, dateInMillis + 1100L);
-    assertEquals(-1100L, h.getSkewInMillis());
-    assertEquals(Math.round(-1100L / 1000L), h.getSkewInSeconds());
-  }
-
-  public void testSkewSingleton() throws Exception {
-    SkewHandler h1 = SkewHandler.getSkewHandlerFromEndpointString("http://foo.com/bar");
-    SkewHandler h2 = SkewHandler.getSkewHandlerForHostname("foo.com");
-    SkewHandler h3 = SkewHandler.getSkewHandlerForResource(new BaseResource("http://foo.com/baz"));
-    assertTrue(h1 == h2);
-    assertTrue(h1 == h3);
-
-    SkewHandler.getSkewHandlerForHostname("foo.com").updateSkewFromServerMillis(1390101412000L, 1390001412000L);
-    final long actual = SkewHandler.getSkewHandlerForHostname("foo.com").getSkewInMillis();
-    assertEquals(100000000L, actual);
-  }
-}
deleted file mode 100644
--- a/mobile/android/tests/background/junit4/src/org/mozilla/gecko/fxa/login/TestFxAccountLoginStateMachine.java.orig
+++ /dev/null
@@ -1,202 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-package org.mozilla.gecko.fxa.login;
-
-import java.security.NoSuchAlgorithmException;
-import java.util.LinkedList;
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.mozilla.gecko.background.fxa.FxAccountClient;
-import org.mozilla.gecko.background.fxa.FxAccountUtils;
-import org.mozilla.gecko.background.testhelpers.WaitHelper;
-import org.mozilla.gecko.browserid.BrowserIDKeyPair;
-import org.mozilla.gecko.browserid.RSACryptoImplementation;
-import org.mozilla.gecko.fxa.login.FxAccountLoginStateMachine.LoginStateMachineDelegate;
-import org.mozilla.gecko.fxa.login.FxAccountLoginTransition.Transition;
-import org.mozilla.gecko.fxa.login.State.StateLabel;
-import org.mozilla.gecko.sync.Utils;
-
-public class TestFxAccountLoginStateMachine {
-  // private static final String TEST_AUDIENCE = "http://testAudience.com";
-  private static final String TEST_EMAIL = "test@test.com";
-  private static byte[] TEST_EMAIL_UTF8;
-  private static final String TEST_PASSWORD = "testtest";
-  private static byte[] TEST_PASSWORD_UTF8;
-  private static byte[] TEST_QUICK_STRETCHED_PW;
-  private static byte[] TEST_UNWRAPKB;
-  private static final byte[] TEST_SESSION_TOKEN = Utils.generateRandomBytes(32);
-  private static final byte[] TEST_KEY_FETCH_TOKEN = Utils.generateRandomBytes(32);
-
-  protected MockFxAccountClient client;
-  protected FxAccountLoginStateMachine sm;
-
-  @Before
-  public void setUp() throws Exception {
-    if (TEST_EMAIL_UTF8 == null) {
-      TEST_EMAIL_UTF8 = TEST_EMAIL.getBytes("UTF-8");
-    }
-    if (TEST_PASSWORD_UTF8 == null) {
-      TEST_PASSWORD_UTF8 = TEST_PASSWORD.getBytes("UTF-8");
-    }
-    if (TEST_QUICK_STRETCHED_PW == null) {
-      TEST_QUICK_STRETCHED_PW = FxAccountUtils.generateQuickStretchedPW(TEST_EMAIL_UTF8, TEST_PASSWORD_UTF8);
-    }
-    if (TEST_UNWRAPKB == null) {
-      TEST_UNWRAPKB = FxAccountUtils.generateUnwrapBKey(TEST_QUICK_STRETCHED_PW);
-    }
-    client = new MockFxAccountClient();
-    sm = new FxAccountLoginStateMachine();
-  }
-
-  protected static class Trace {
-    public final LinkedList<State> states;
-    public final LinkedList<Transition> transitions;
-
-    public Trace(LinkedList<State> states, LinkedList<Transition> transitions) {
-      this.states = states;
-      this.transitions = transitions;
-    }
-
-    public void assertEquals(String string) {
-      Assert.assertArrayEquals(string.split(", "), toString().split(", "));
-    }
-
-    @Override
-    public String toString() {
-      final LinkedList<State> states = new LinkedList<State>(this.states);
-      final LinkedList<Transition> transitions = new LinkedList<Transition>(this.transitions);
-      LinkedList<String> names = new LinkedList<String>();
-      State state;
-      while ((state = states.pollFirst()) != null) {
-        names.add(state.getStateLabel().name());
-        Transition transition = transitions.pollFirst();
-        if (transition != null) {
-          names.add(">" + transition.toString());
-        }
-      }
-      return names.toString();
-    }
-
-    public String stateString() {
-      LinkedList<String> names = new LinkedList<String>();
-      for (State state : states) {
-        names.add(state.getStateLabel().name());
-      }
-      return names.toString();
-    }
-
-    public String transitionString() {
-      LinkedList<String> names = new LinkedList<String>();
-      for (Transition transition : transitions) {
-        names.add(transition.toString());
-      }
-      return names.toString();
-    }
-  }
-
-  protected Trace trace(final State initialState, final StateLabel desiredState) {
-    final LinkedList<Transition> transitions = new LinkedList<Transition>();
-    final LinkedList<State> states = new LinkedList<State>();
-    states.add(initialState);
-
-    WaitHelper.getTestWaiter().performWait(new Runnable() {
-      @Override
-      public void run() {
-        sm.advance(initialState, desiredState, new LoginStateMachineDelegate() {
-          @Override
-          public void handleTransition(Transition transition, State state) {
-            transitions.add(transition);
-            states.add(state);
-          }
-
-          @Override
-          public void handleFinal(State state) {
-            WaitHelper.getTestWaiter().performNotify();
-          }
-
-          @Override
-          public FxAccountClient getClient() {
-            return client;
-          }
-
-          @Override
-          public long getCertificateDurationInMilliseconds() {
-            return 30 * 1000;
-          }
-
-          @Override
-          public long getAssertionDurationInMilliseconds() {
-            return 10 * 1000;
-          }
-
-          @Override
-          public BrowserIDKeyPair generateKeyPair() throws NoSuchAlgorithmException {
-            return RSACryptoImplementation.generateKeyPair(512);
-          }
-        });
-      }
-    });
-
-    return new Trace(states, transitions);
-  }
-
-  @Test
-  public void testEnagedUnverified() throws Exception {
-    client.addUser(TEST_EMAIL, TEST_QUICK_STRETCHED_PW, false, TEST_SESSION_TOKEN, TEST_KEY_FETCH_TOKEN);
-    Trace trace = trace(new Engaged(TEST_EMAIL, "uid", true, TEST_UNWRAPKB, TEST_SESSION_TOKEN, TEST_KEY_FETCH_TOKEN), StateLabel.Married);
-    trace.assertEquals("[Engaged, >AccountNeedsVerification, Engaged]");
-  }
-
-  @Test
-  public void testEngagedTransitionToAccountVerified() throws Exception {
-    client.addUser(TEST_EMAIL, TEST_QUICK_STRETCHED_PW, true, TEST_SESSION_TOKEN, TEST_KEY_FETCH_TOKEN);
-    Trace trace = trace(new Engaged(TEST_EMAIL, "uid", false, TEST_UNWRAPKB, TEST_SESSION_TOKEN, TEST_KEY_FETCH_TOKEN), StateLabel.Married);
-    trace.assertEquals("[Engaged, >AccountVerified, Cohabiting, >LogMessage('sign succeeded'), Married]");
-  }
-
-  @Test
-  public void testEngagedVerified() throws Exception {
-    client.addUser(TEST_EMAIL, TEST_QUICK_STRETCHED_PW, true, TEST_SESSION_TOKEN, TEST_KEY_FETCH_TOKEN);
-    Trace trace = trace(new Engaged(TEST_EMAIL, "uid", true, TEST_UNWRAPKB, TEST_SESSION_TOKEN, TEST_KEY_FETCH_TOKEN), StateLabel.Married);
-    trace.assertEquals("[Engaged, >LogMessage('keys succeeded'), Cohabiting, >LogMessage('sign succeeded'), Married]");
-  }
-
-  @Test
-  public void testPartial() throws Exception {
-    client.addUser(TEST_EMAIL, TEST_QUICK_STRETCHED_PW, true, TEST_SESSION_TOKEN, TEST_KEY_FETCH_TOKEN);
-    // What if we stop at Cohabiting?
-    Trace trace = trace(new Engaged(TEST_EMAIL, "uid", true, TEST_UNWRAPKB, TEST_SESSION_TOKEN, TEST_KEY_FETCH_TOKEN), StateLabel.Cohabiting);
-    trace.assertEquals("[Engaged, >LogMessage('keys succeeded'), Cohabiting]");
-  }
-
-  @Test
-  public void testBadSessionToken() throws Exception {
-    client.addUser(TEST_EMAIL, TEST_QUICK_STRETCHED_PW, true, TEST_SESSION_TOKEN, TEST_KEY_FETCH_TOKEN);
-    client.sessionTokens.clear();
-    Trace trace = trace(new Engaged(TEST_EMAIL, "uid", true, TEST_UNWRAPKB, TEST_SESSION_TOKEN, TEST_KEY_FETCH_TOKEN), StateLabel.Married);
-    trace.assertEquals("[Engaged, >LogMessage('keys succeeded'), Cohabiting, >Log(<FxAccountClientRemoteException 401 [110]: invalid sessionToken>), Separated, >PasswordRequired, Separated]");
-  }
-
-  @Test
-  public void testBadKeyFetchToken() throws Exception {
-    client.addUser(TEST_EMAIL, TEST_QUICK_STRETCHED_PW, true, TEST_SESSION_TOKEN, TEST_KEY_FETCH_TOKEN);
-    client.keyFetchTokens.clear();
-    Trace trace = trace(new Engaged(TEST_EMAIL, "uid", true, TEST_UNWRAPKB, TEST_SESSION_TOKEN, TEST_KEY_FETCH_TOKEN), StateLabel.Married);
-    trace.assertEquals("[Engaged, >Log(<FxAccountClientRemoteException 401 [110]: invalid keyFetchToken>), Separated, >PasswordRequired, Separated]");
-  }
-
-  @Test
-  public void testMarried() throws Exception {
-    client.addUser(TEST_EMAIL, TEST_QUICK_STRETCHED_PW, true, TEST_SESSION_TOKEN, TEST_KEY_FETCH_TOKEN);
-    Trace trace = trace(new Engaged(TEST_EMAIL, "uid", true, TEST_UNWRAPKB, TEST_SESSION_TOKEN, TEST_KEY_FETCH_TOKEN), StateLabel.Married);
-    trace.assertEquals("[Engaged, >LogMessage('keys succeeded'), Cohabiting, >LogMessage('sign succeeded'), Married]");
-    // What if we're already in the desired state?
-    State married = trace.states.getLast();
-    Assert.assertEquals(StateLabel.Married, married.getStateLabel());
-    trace = trace(married, StateLabel.Married);
-    trace.assertEquals("[Married]");
-  }
-}
deleted file mode 100644
--- a/mobile/android/tests/background/junit4/src/org/mozilla/gecko/fxa/login/TestStateFactory.java.orig
+++ /dev/null
@@ -1,89 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-package org.mozilla.gecko.fxa.login;
-
-import junit.framework.Assert;
-
-import org.junit.Test;
-import org.mozilla.gecko.browserid.BrowserIDKeyPair;
-import org.mozilla.gecko.browserid.DSACryptoImplementation;
-import org.mozilla.gecko.fxa.login.State.StateLabel;
-import org.mozilla.gecko.sync.ExtendedJSONObject;
-import org.mozilla.gecko.sync.Utils;
-
-public class TestStateFactory {
-  @Test
-  public void testGetStateV3() throws Exception {
-    MigratedFromSync11 migrated = new MigratedFromSync11("email", "uid", true, "password");
-
-    // For the current version, we expect to read back what we wrote.
-    ExtendedJSONObject o;
-    State state;
-
-    o = migrated.toJSONObject();
-    Assert.assertEquals(3, o.getLong("version").intValue());
-    state = StateFactory.fromJSONObject(migrated.stateLabel, o);
-    Assert.assertEquals(StateLabel.MigratedFromSync11, state.stateLabel);
-    Assert.assertEquals(o, state.toJSONObject());
-
-    // Null passwords are OK.
-    MigratedFromSync11 migratedNullPassword = new MigratedFromSync11("email", "uid", true, null);
-
-    o = migratedNullPassword.toJSONObject();
-    Assert.assertEquals(3, o.getLong("version").intValue());
-    state = StateFactory.fromJSONObject(migratedNullPassword.stateLabel, o);
-    Assert.assertEquals(StateLabel.MigratedFromSync11, state.stateLabel);
-    Assert.assertEquals(o, state.toJSONObject());
-  }
-
-  @Test
-  public void testGetStateV2() throws Exception {
-    byte[] sessionToken = Utils.generateRandomBytes(32);
-    byte[] kA = Utils.generateRandomBytes(32);
-    byte[] kB = Utils.generateRandomBytes(32);
-    BrowserIDKeyPair keyPair = DSACryptoImplementation.generateKeyPair(512);
-    Cohabiting cohabiting = new Cohabiting("email", "uid", sessionToken, kA, kB, keyPair);
-    String certificate = "certificate";
-    Married married = new Married("email", "uid", sessionToken, kA, kB, keyPair, certificate);
-
-    // For the current version, we expect to read back what we wrote.
-    ExtendedJSONObject o;
-    State state;
-
-    o = married.toJSONObject();
-    Assert.assertEquals(3, o.getLong("version").intValue());
-    state = StateFactory.fromJSONObject(married.stateLabel, o);
-    Assert.assertEquals(StateLabel.Married, state.stateLabel);
-    Assert.assertEquals(o, state.toJSONObject());
-
-    o = cohabiting.toJSONObject();
-    Assert.assertEquals(3, o.getLong("version").intValue());
-    state = StateFactory.fromJSONObject(cohabiting.stateLabel, o);
-    Assert.assertEquals(StateLabel.Cohabiting, state.stateLabel);
-    Assert.assertEquals(o, state.toJSONObject());
-  }
-
-  @Test
-  public void testGetStateV1() throws Exception {
-    // We can't rely on generating correct V1 objects (since the generation code
-    // may change); so we hard code a few test examples here. These examples
-    // have RSA key pairs; when they're parsed, we return DSA key pairs.
-    ExtendedJSONObject o = new ExtendedJSONObject("{\"uid\":\"uid\",\"sessionToken\":\"4e2830da6ce466ddb401fbca25b96a621209eea83851254800f84cc4069ef011\",\"certificate\":\"certificate\",\"keyPair\":{\"publicKey\":{\"e\":\"65537\",\"n\":\"7598360104379019497828904063491254083855849024432238665262988260947462372141971045236693389494635158997975098558915846889960089362159921622822266839560631\",\"algorithm\":\"RS\"},\"privateKey\":{\"d\":\"6807533330618101360064115400338014782301295929300445938471117364691566605775022173055292460962170873583673516346599808612503093914221141089102289381448225\",\"n\":\"7598360104379019497828904063491254083855849024432238665262988260947462372141971045236693389494635158997975098558915846889960089362159921622822266839560631\",\"algorithm\":\"RS\"}},\"email\":\"email\",\"verified\":true,\"kB\":\"0b048f285c19067f200da7bfbe734ed213cefcd8f543f0fdd4a8ccab48cbbc89\",\"kA\":\"59a9edf2d41de8b24e69df9133bc88e96913baa75421882f4c55d842d18fc8a1\",\"version\":1}");
-    // A Married state is regressed to a Cohabited state.
-    Cohabiting state = (Cohabiting) StateFactory.fromJSONObject(StateLabel.Married, o);
-
-    Assert.assertEquals(StateLabel.Cohabiting, state.stateLabel);
-    Assert.assertEquals("uid", state.uid);
-    Assert.assertEquals("4e2830da6ce466ddb401fbca25b96a621209eea83851254800f84cc4069ef011", Utils.byte2Hex(state.sessionToken));
-    Assert.assertEquals("DS128", state.keyPair.getPrivate().getAlgorithm());
-
-    o = new ExtendedJSONObject("{\"uid\":\"uid\",\"sessionToken\":\"4e2830da6ce466ddb401fbca25b96a621209eea83851254800f84cc4069ef011\",\"keyPair\":{\"publicKey\":{\"e\":\"65537\",\"n\":\"7598360104379019497828904063491254083855849024432238665262988260947462372141971045236693389494635158997975098558915846889960089362159921622822266839560631\",\"algorithm\":\"RS\"},\"privateKey\":{\"d\":\"6807533330618101360064115400338014782301295929300445938471117364691566605775022173055292460962170873583673516346599808612503093914221141089102289381448225\",\"n\":\"7598360104379019497828904063491254083855849024432238665262988260947462372141971045236693389494635158997975098558915846889960089362159921622822266839560631\",\"algorithm\":\"RS\"}},\"email\":\"email\",\"verified\":true,\"kB\":\"0b048f285c19067f200da7bfbe734ed213cefcd8f543f0fdd4a8ccab48cbbc89\",\"kA\":\"59a9edf2d41de8b24e69df9133bc88e96913baa75421882f4c55d842d18fc8a1\",\"version\":1}");
-    state = (Cohabiting) StateFactory.fromJSONObject(StateLabel.Cohabiting, o);
-
-    Assert.assertEquals(StateLabel.Cohabiting, state.stateLabel);
-    Assert.assertEquals("uid", state.uid);
-    Assert.assertEquals("4e2830da6ce466ddb401fbca25b96a621209eea83851254800f84cc4069ef011", Utils.byte2Hex(state.sessionToken));
-    Assert.assertEquals("DS128", state.keyPair.getPrivate().getAlgorithm());
-  }
-}
--- a/modules/libjar/moz.build
+++ b/modules/libjar/moz.build
@@ -42,8 +42,11 @@ SOURCES += [
     'nsJARFactory.cpp',
     'nsJARInputStream.cpp',
     'nsZipArchive.cpp',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/modules/libjar/zipwriter/moz.build
+++ b/modules/libjar/zipwriter/moz.build
@@ -17,8 +17,11 @@ UNIFIED_SOURCES += [
     'nsZipDataStream.cpp',
     'nsZipHeader.cpp',
     'nsZipWriter.cpp',
     'StreamFunctions.cpp',
     'ZipWriterModule.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/modules/libmar/verify/moz.build
+++ b/modules/libmar/verify/moz.build
@@ -25,8 +25,10 @@ elif CONFIG['OS_ARCH'] == 'Darwin':
 else:
     DEFINES['MAR_NSS'] = True
     LOCAL_INCLUDES += ['../sign']
 
 LOCAL_INCLUDES += [
     '../src',
 ]
 
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/modules/libpref/moz.build
+++ b/modules/libpref/moz.build
@@ -37,8 +37,11 @@ SOURCES += [
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 DEFINES['OS_ARCH'] = CONFIG['OS_ARCH']
 DEFINES['MOZ_WIDGET_TOOLKIT'] = CONFIG['MOZ_WIDGET_TOOLKIT']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/mozglue/build/moz.build
+++ b/mozglue/build/moz.build
@@ -100,8 +100,11 @@ if CONFIG['OS_TARGET'] == 'Darwin':
     # might be possible to find a way to avoid all such symbol resolutions,
     # it's currently not possible because at the very least there's a call
     # to pthread_self from tsd_init_check_recursion, which is necessary
     # because somehow clang doesn't want to accept the __thread keyword
     # for TLS.
     LDFLAGS += ['-Wl,-bind_at_load']
 
 DIST_INSTALL = True
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/mozglue/misc/moz.build
+++ b/mozglue/misc/moz.build
@@ -38,8 +38,11 @@ elif CONFIG['COMPILE_ENVIRONMENT']:
 # the conditions for GeckoStackWalk to work correctly.
 # We exclude this file from other build configurations so that if somebody adds a
 # new usage of NS_StackWalk it will cause a link error, which is better than having
 # GeckoStackWalk silently return garbage at runtime.
 if CONFIG['MOZ_STACKWALKING']:
     SOURCES += [
         'StackWalk.cpp',
     ]
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/netwerk/streamconv/moz.build
+++ b/netwerk/streamconv/moz.build
@@ -18,8 +18,11 @@ XPIDL_SOURCES += [
 
 SOURCES += [
     'nsStreamConverterService.cpp',
 ]
 
 XPIDL_MODULE = 'necko_strconv'
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/netwerk/system/android/moz.build
+++ b/netwerk/system/android/moz.build
@@ -8,8 +8,10 @@ SOURCES += [
     'nsAndroidNetworkLinkService.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
 LOCAL_INCLUDES += [
     '/netwerk/base',
 ]
 
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/netwerk/system/linux/moz.build
+++ b/netwerk/system/linux/moz.build
@@ -5,8 +5,11 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 if CONFIG['OS_ARCH'] == 'Linux':
     SOURCES += [
         'nsNotifyAddrListener_Linux.cpp',
     ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/netwerk/system/qt/moz.build
+++ b/netwerk/system/qt/moz.build
@@ -11,8 +11,11 @@ SOURCES += [
 ]
 
 FINAL_LIBRARY = 'xul'
 LOCAL_INCLUDES += [
     '/netwerk/base',
 ]
 
 CXXFLAGS += CONFIG['MOZ_QT_CFLAGS']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/rdf/build/moz.build
+++ b/rdf/build/moz.build
@@ -13,8 +13,11 @@ SOURCES += [
 ]
 
 FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
     '/rdf/base',
     '/rdf/datasource',
 ]
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/rdf/datasource/moz.build
+++ b/rdf/datasource/moz.build
@@ -16,10 +16,12 @@ UNIFIED_SOURCES += [
 FINAL_LIBRARY = 'xul'
 
 # "This is a dependency on rdfutil.h: it'll go away once that becomes
 # a first-class XPCOM interface."
 LOCAL_INCLUDES += [
     '/rdf/base',
 ]
 
-if not CONFIG['GNU_CXX']:
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
+else:
     ALLOW_COMPILER_WARNINGS = True
--- a/rdf/tests/rdfcat/moz.build
+++ b/rdf/tests/rdfcat/moz.build
@@ -6,8 +6,11 @@
 
 GeckoProgram('rdfcat', linkage='dependent')
 
 SOURCES += [
     'rdfcat.cpp',
 ]
 
 CXXFLAGS += CONFIG['TK_CFLAGS']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/rdf/tests/rdfpoll/moz.build
+++ b/rdf/tests/rdfpoll/moz.build
@@ -4,8 +4,11 @@
 # 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/.
 
 GeckoProgram('rdfpoll', linkage='dependent')
 
 SOURCES += [
     'rdfpoll.cpp',
 ]
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/rdf/tests/triplescat/moz.build
+++ b/rdf/tests/triplescat/moz.build
@@ -6,8 +6,11 @@
 
 GeckoProgram('triplescat', linkage='dependent')
 
 SOURCES += [
     'triplescat.cpp',
 ]
 
 CXXFLAGS += CONFIG['TK_CFLAGS']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/toolkit/components/alerts/moz.build
+++ b/toolkit/components/alerts/moz.build
@@ -20,8 +20,11 @@ UNIFIED_SOURCES += [
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 JAR_MANIFESTS += ['jar.mn']
 
 with Files('**'):
     BUG_COMPONENT = ('Toolkit', 'Notifications and Alerts')
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/toolkit/components/autocomplete/moz.build
+++ b/toolkit/components/autocomplete/moz.build
@@ -21,8 +21,11 @@ UNIFIED_SOURCES += [
     'nsAutoCompleteController.cpp',
     'nsAutoCompleteSimpleResult.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
 
 with Files('**'):
     BUG_COMPONENT = ('Toolkit', 'Autocomplete')
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/toolkit/components/build/moz.build
+++ b/toolkit/components/build/moz.build
@@ -32,8 +32,11 @@ if not CONFIG['MOZ_DISABLE_PARENTAL_CONT
     LOCAL_INCLUDES += [
         '../parentalcontrols',
     ]
 
 if CONFIG['NIGHTLY_BUILD']:
     LOCAL_INCLUDES += [
         '../perfmonitoring',
     ]
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/toolkit/components/commandlines/moz.build
+++ b/toolkit/components/commandlines/moz.build
@@ -23,8 +23,11 @@ XPIDL_MODULE = 'commandlines'
 SOURCES += [
     'nsCommandLine.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
 
 with Files('**'):
     BUG_COMPONENT = ('Toolkit', 'Startup and Profile System')
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/toolkit/components/ctypes/moz.build
+++ b/toolkit/components/ctypes/moz.build
@@ -17,8 +17,11 @@ LOCAL_INCLUDES += [
 EXTRA_JS_MODULES += [
     'ctypes.jsm',
 ]
 
 FINAL_LIBRARY = 'xul'
 
 with Files('**'):
     BUG_COMPONENT = ('Core', 'js-ctypes')
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/toolkit/components/ctypes/tests/moz.build
+++ b/toolkit/components/ctypes/tests/moz.build
@@ -15,8 +15,11 @@ UNIFIED_SOURCES += [
     'jsctypes-test.cpp',
 ]
 
 SharedLibrary('jsctypes-test')
 
 LOCAL_INCLUDES += [
     '/js/src/ctypes',
 ]
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/toolkit/components/diskspacewatcher/moz.build
+++ b/toolkit/components/diskspacewatcher/moz.build
@@ -16,8 +16,11 @@ XPIDL_MODULE = 'diskspacewatcher'
 
 SOURCES = [
     'DiskSpaceWatcher.cpp',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/toolkit/components/filepicker/moz.build
+++ b/toolkit/components/filepicker/moz.build
@@ -20,8 +20,11 @@ if CONFIG['MOZ_XUL'] and \
             'nsFilePicker.manifest',
         ]
         XPCSHELL_TESTS_MANIFESTS += [
             'test/unit/xpcshell.ini',
         ]
         FINAL_LIBRARY = 'xul'
 
 JAR_MANIFESTS += ['jar.mn']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/toolkit/components/finalizationwitness/moz.build
+++ b/toolkit/components/finalizationwitness/moz.build
@@ -18,8 +18,11 @@ EXPORTS.mozilla += [
     'FinalizationWitnessService.h',
 ]
 
 LOCAL_INCLUDES += [
     '/js/xpconnect/loader',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/toolkit/components/find/moz.build
+++ b/toolkit/components/find/moz.build
@@ -10,8 +10,11 @@ XPIDL_SOURCES += [
 
 XPIDL_MODULE = 'mozfind'
 
 SOURCES += [
     'nsFindService.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/toolkit/components/jsdownloads/src/moz.build
+++ b/toolkit/components/jsdownloads/src/moz.build
@@ -24,8 +24,11 @@ EXTRA_JS_MODULES += [
 EXTRA_PP_JS_MODULES += [
     'DownloadIntegration.jsm',
     'DownloadUIHelper.jsm',
 ]
 
 FINAL_LIBRARY = 'xul'
 
 CXXFLAGS += CONFIG['TK_CFLAGS']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/toolkit/components/osfile/moz.build
+++ b/toolkit/components/osfile/moz.build
@@ -28,8 +28,11 @@ EXPORTS.mozilla += [
 EXTRA_PP_JS_MODULES += [
     'osfile.jsm',
 ]
 
 FINAL_LIBRARY = 'xul'
 
 with Files('**'):
     BUG_COMPONENT = ('Toolkit', 'OS.File')
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/toolkit/components/parentalcontrols/moz.build
+++ b/toolkit/components/parentalcontrols/moz.build
@@ -24,8 +24,11 @@ if not CONFIG['MOZ_DISABLE_PARENTAL_CONT
             'nsParentalControlsServiceAndroid.cpp',
         ]
     else:
         SOURCES += [
             'nsParentalControlsServiceDefault.cpp',
         ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/toolkit/components/perf/moz.build
+++ b/toolkit/components/perf/moz.build
@@ -14,8 +14,11 @@ EXTRA_JS_MODULES += [
 
 FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
     '/js/xpconnect/loader',
 ]
 
 MOCHITEST_CHROME_MANIFESTS += ['chrome.ini']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/toolkit/components/reflect/moz.build
+++ b/toolkit/components/reflect/moz.build
@@ -8,8 +8,11 @@ SOURCES += [
     'reflect.cpp',
 ]
 
 EXTRA_JS_MODULES += [
     'reflect.jsm',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/toolkit/components/satchel/moz.build
+++ b/toolkit/components/satchel/moz.build
@@ -43,8 +43,11 @@ EXTRA_JS_MODULES += [
 
 EXTRA_PP_JS_MODULES += [
     'FormHistory.jsm',
 ]
 
 FINAL_LIBRARY = 'xul'
 
 JAR_MANIFESTS += ['jar.mn']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/toolkit/components/startup/moz.build
+++ b/toolkit/components/startup/moz.build
@@ -31,8 +31,11 @@ else:
     UNIFIED_SOURCES += [
         'nsUserInfoUnix.cpp',
     ]
 
 FINAL_LIBRARY = 'xul'
 
 with Files('**'):
     BUG_COMPONENT = ('Toolkit', 'Startup and Profile System')
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/toolkit/components/statusfilter/moz.build
+++ b/toolkit/components/statusfilter/moz.build
@@ -4,8 +4,11 @@
 # 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/.
 
 SOURCES += [
     'nsBrowserStatusFilter.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/toolkit/components/terminator/moz.build
+++ b/toolkit/components/terminator/moz.build
@@ -15,8 +15,11 @@ EXPORTS += [
 ]
 
 EXTRA_COMPONENTS += [
     'nsTerminatorTelemetry.js',
     'terminator.manifest',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/toolkit/components/typeaheadfind/moz.build
+++ b/toolkit/components/typeaheadfind/moz.build
@@ -15,8 +15,11 @@ SOURCES += [
 ]
 
 FINAL_LIBRARY = 'xul'
 
 JAR_MANIFESTS += ['jar.mn']
 
 with Files('**'):
     BUG_COMPONENT = ('Toolkit', 'Find Toolbar')
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/toolkit/components/workerlz4/moz.build
+++ b/toolkit/components/workerlz4/moz.build
@@ -11,8 +11,11 @@ EXTRA_JS_MODULES.workers += [
     'lz4_internal.js',
 ]
 
 SOURCES += [
     'lz4.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/toolkit/system/androidproxy/moz.build
+++ b/toolkit/system/androidproxy/moz.build
@@ -4,8 +4,11 @@
 # 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/.
 
 SOURCES += [
     'nsAndroidSystemProxySettings.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/toolkit/system/gnome/moz.build
+++ b/toolkit/system/gnome/moz.build
@@ -35,8 +35,11 @@ CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS
 
 if CONFIG['MOZ_ENABLE_GTK']:
     CXXFLAGS += CONFIG['TK_CFLAGS']
 
 OS_LIBS += CONFIG['MOZ_GCONF_LIBS']
 OS_LIBS += CONFIG['GLIB_LIBS']
 OS_LIBS += CONFIG['MOZ_GIO_LIBS']
 OS_LIBS += CONFIG['MOZ_DBUS_GLIB_LIBS']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/toolkit/system/unixproxy/moz.build
+++ b/toolkit/system/unixproxy/moz.build
@@ -10,8 +10,11 @@ if CONFIG['MOZ_ENABLE_LIBPROXY']:
         'nsLibProxySettings.cpp',
     ]
 else:
     SOURCES += [
         'nsUnixSystemProxySettings.cpp',
     ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/uriloader/base/moz.build
+++ b/uriloader/base/moz.build
@@ -24,8 +24,11 @@ EXPORTS += [
 ]
 
 UNIFIED_SOURCES += [
     'nsDocLoader.cpp',
     'nsURILoader.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/widget/android/jni/moz.build
+++ b/widget/android/jni/moz.build
@@ -16,8 +16,11 @@ UNIFIED_SOURCES += [
     'Utils.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
     '/widget/android',
 ]
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/widget/qt/moz.build
+++ b/widget/qt/moz.build
@@ -59,8 +59,11 @@ if CONFIG['OS_ARCH'] == 'SunOS' and not 
     # line 29: Error: Multiple declaration for std::tm.
     # So, this gets around the problem.
     DEFINES['_TIME_H'] = 1
 
 CXXFLAGS += CONFIG['MOZ_QT_CFLAGS']
 CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
 CFLAGS += CONFIG['MOZ_QT_CFLAGS']
 CFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/widget/uikit/moz.build
+++ b/widget/uikit/moz.build
@@ -12,8 +12,11 @@ SOURCES += [
     'nsWidgetFactory.mm',
     'nsWindow.mm',
 ]
 
 FINAL_LIBRARY = 'xul'
 LOCAL_INCLUDES += [
     '/widget',
 ]
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/widget/xremoteclient/moz.build
+++ b/widget/xremoteclient/moz.build
@@ -4,8 +4,11 @@
 # 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 = 'xul'
 
 SOURCES += [
     'XRemoteClient.cpp',
 ]
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/xpcom/glue/tests/gtest/moz.build
+++ b/xpcom/glue/tests/gtest/moz.build
@@ -11,8 +11,11 @@ UNIFIED_SOURCES += [
     'TestThreadUtils.cpp',
 ]
 
 LOCAL_INCLUDES = [
     '../..',
 ]
 
 FINAL_LIBRARY = 'xul-gtest'
+
+if CONFIG['CLANG_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/xpcom/reflect/xptcall/moz.build
+++ b/xpcom/reflect/xptcall/moz.build
@@ -16,8 +16,11 @@ EXPORTS += [
     'xptcstubsdef.inc',
 ]
 
 LOCAL_INCLUDES += [
     '/xpcom/reflect/xptinfo',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/xpcom/reflect/xptinfo/moz.build
+++ b/xpcom/reflect/xptinfo/moz.build
@@ -27,8 +27,11 @@ EXPORTS.mozilla += [
     'XPTInterfaceInfoManager.h',
 ]
 
 LOCAL_INCLUDES += [
     '/dom/base',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['CLANG_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/xpcom/system/moz.build
+++ b/xpcom/system/moz.build
@@ -20,8 +20,10 @@ XPIDL_SOURCES += [
 
 if CONFIG['MOZ_CRASHREPORTER']:
     XPIDL_SOURCES += [
         'nsICrashReporter.idl',
     ]
 
 XPIDL_MODULE = 'xpcom_system'
 
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/xpcom/tests/component/moz.build
+++ b/xpcom/tests/component/moz.build
@@ -16,8 +16,11 @@ DEFINES['LIBRARY_FILENAME'] = '%s%s%s' %
     CONFIG['DLL_PREFIX'],
     LIBRARY_NAME,
     CONFIG['DLL_SUFFIX']
 )
 
 # Need to link with CoreFoundation on Mac
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     OS_LIBS += CONFIG['TK_LIBS']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/xpcom/tests/component_no_aslr/moz.build
+++ b/xpcom/tests/component_no_aslr/moz.build
@@ -16,8 +16,11 @@ DEFINES['LIBRARY_FILENAME'] = '%s%s%s' %
     CONFIG['DLL_PREFIX'],
     LIBRARY_NAME,
     CONFIG['DLL_SUFFIX']
 )
 
 # Need to link with CoreFoundation on Mac
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     OS_LIBS += CONFIG['TK_LIBS']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
--- a/xulrunner/examples/simple/components/src/moz.build
+++ b/xulrunner/examples/simple/components/src/moz.build
@@ -11,8 +11,11 @@ SOURCES += [
 XPCOMBinaryComponent('simpletest')
 
 EXTRA_COMPONENTS += [
     'SimpleTest.js',
     'SimpleTest.manifest',
 ]
 
 XPI_NAME = 'simple'
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']