Bug 1232219 (part 4) - Enable -Wunused for C code, except where it's too annoying. r=glandium.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 16 Dec 2015 22:59:42 -0800
changeset 315416 540f77351ef1eed4f32a585eb5003cf86ebb5482
parent 315415 96f1081a231c2c07ef86dbc21469804f09efb4ad
child 315417 94eef5cd59ef40297e747e1a4ecb55b901e85be9
push id1079
push userjlund@mozilla.com
push dateFri, 15 Apr 2016 21:02:33 +0000
treeherdermozilla-release@575fbf6786d5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1232219
milestone46.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1232219 (part 4) - Enable -Wunused for C code, except where it's too annoying. r=glandium.
configure.in
gfx/cairo/libpixman/src/moz.build
js/src/configure.in
media/libvpx/moz.build
memory/mozjemalloc/moz.build
xpcom/build/moz.build
--- a/configure.in
+++ b/configure.in
@@ -1484,19 +1484,16 @@ if test "$GNU_CC"; then
            *)
         _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wcast-align"
            ;;
        esac
     fi
 
     # Turn off some non-useful warnings that -Wall turns on.
 
-    # -Wno-unused - lots of violations in third-party code
-    _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wno-unused"
-
     # -Wno-unused-local-typedef - catches unused typedefs, which are commonly used in assertion macros
     MOZ_C_SUPPORTS_WARNING(-Wno-, unused-local-typedef, ac_c_has_wno_unused_local_typedef)
 
     _DEFINES_CFLAGS='-include $(topobjdir)/mozilla-config.h -DMOZILLA_CLIENT'
     _USE_CPP_INCLUDE_FLAG=1
 
     ASFLAGS="$ASFLAGS $_DEFINES_CFLAGS"
 
--- a/gfx/cairo/libpixman/src/moz.build
+++ b/gfx/cairo/libpixman/src/moz.build
@@ -134,18 +134,19 @@ if use_arm_neon_gcc:
     DEFINES['USE_ARM_NEON'] = True
     SOURCES += ['pixman-arm-neon.c']
     SOURCES['pixman-arm-neon.c'].flags += ['-mfpu=neon']
 
 # Suppress warnings in third-party code.
 if CONFIG['GNU_CC']:
     CFLAGS += [
         '-Wno-address',
+        '-Wno-missing-field-initializers',
         '-Wno-sign-compare',
-        '-Wno-missing-field-initializers',
+        '-Wno-unused',                      # too many unused warnings; ignore
     ]
     if CONFIG['CLANG_CXX']:
         CFLAGS += [
             '-Wno-incompatible-pointer-types',
             '-Wno-tautological-compare',
             '-Wno-tautological-constant-out-of-range-compare',
         ]
 
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -1227,19 +1227,16 @@ if test "$GNU_CC"; then
            *)
         _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wcast-align"
            ;;
        esac
     fi
 
     # Turn off some non-useful warnings that -Wall turns on.
 
-    # -Wno-unused - lots of violations in third-party code
-    _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wno-unused"
-
     # -Wno-unused-local-typedef - catches unused typedefs, which are commonly used in assertion macros
     MOZ_C_SUPPORTS_WARNING(-Wno-, unused-local-typedef, ac_c_has_wno_unused_local_typedef)
 
     _DEFINES_CFLAGS='-include $(topobjdir)/js/src/js-confdefs.h -DMOZILLA_CLIENT'
     _USE_CPP_INCLUDE_FLAG=1
 
 elif test "$SOLARIS_SUNPRO_CC"; then
     DSO_CFLAGS=''
--- a/media/libvpx/moz.build
+++ b/media/libvpx/moz.build
@@ -78,17 +78,20 @@ if CONFIG['CLANG_CL'] or not CONFIG['_MS
                 SOURCES[f].flags += ['-mssse3']
             if 'sse4' in f:
                 SOURCES[f].flags += ['-msse4.1']
             if 'avx2' in f:
                 SOURCES[f].flags += ['-mavx2']
 
 # Suppress warnings in third-party code.
 if CONFIG['GNU_CC']:
-    CFLAGS += ['-Wno-sign-compare']
+    CFLAGS += [
+        '-Wno-sign-compare',
+        '-Wno-unused-function', # so many of these warnings; just ignore them
+    ]
 
 ASFLAGS += CONFIG['VPX_ASFLAGS']
 ASFLAGS += [
     '-I.',
     '-I%s/media/libvpx/' % TOPSRCDIR,
     '-I%s/media/libvpx/vpx_ports/' % TOPSRCDIR,
 ]
 
--- a/memory/mozjemalloc/moz.build
+++ b/memory/mozjemalloc/moz.build
@@ -38,12 +38,15 @@ if CONFIG['OS_TARGET'] == 'Linux':
 if CONFIG['MOZ_NUWA_PROCESS']:
     DEFINES['pthread_mutex_lock'] = '__real_pthread_mutex_lock';
 
 LOCAL_INCLUDES += [
     '/memory/build',
 ]
 
 if CONFIG['GNU_CC']:
-    CFLAGS += ['-Wshadow']
+    CFLAGS += [
+        '-Wshadow',
+        '-Wno-unused',  # too many annoying fatal warnings from mfbt/ headers
+    ]
 
 if CONFIG['_MSC_VER']:
     CFLAGS += ['-wd4273'] # inconsistent dll linkage (bug 558163)
--- a/xpcom/build/moz.build
+++ b/xpcom/build/moz.build
@@ -29,20 +29,21 @@ if CONFIG['OS_ARCH'] == 'WINNT':
     EXPORTS.mozilla += ['perfprobe.h']
     SOURCES += [
         'perfprobe.cpp',
         'PoisonIOInterposerBase.cpp',
         'PoisonIOInterposerWin.cpp',
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     UNIFIED_SOURCES += [
-        'mach_override.c',
         'PoisonIOInterposerBase.cpp',
         'PoisonIOInterposerMac.cpp',
     ]
+    SOURCES += ['mach_override.c']
+    SOURCES['mach_override.c'].flags += ['-Wno-unused-function']
 else:
     SOURCES += ['PoisonIOInterposerStub.cpp']
 
 include('../glue/objs.mozbuild')
 
 UNIFIED_SOURCES += xpcom_gluens_src_cppsrcs
 UNIFIED_SOURCES += xpcom_glue_src_cppsrcs