Bug 1125665 - Fix -Wunused-private-field warning in PLDHashTable and mark xpcom/glue as FAIL_ON_WARNINGS. r=froydnj
authorChris Peterson <cpeterson@mozilla.com>
Sun, 25 Jan 2015 00:25:13 -0800
changeset 239283 a9edb65373b8d0c3874a69461dc069fb04ab96b2
parent 239282 23943d3f9c0e8bb42807a28be948c7a02466589f
child 239284 a38c9be1a4be049605c63a9c89a8fe0d8bda561a
push id497
push usermleibovic@mozilla.com
push dateWed, 28 Jan 2015 16:43:37 +0000
reviewersfroydnj
bugs1125665
milestone38.0a1
Bug 1125665 - Fix -Wunused-private-field warning in PLDHashTable and mark xpcom/glue as FAIL_ON_WARNINGS. r=froydnj
xpcom/glue/moz.build
xpcom/glue/nomozalloc/moz.build
xpcom/glue/pldhash.h
xpcom/glue/standalone/moz.build
xpcom/glue/standalone/staticruntime/moz.build
xpcom/glue/staticruntime/moz.build
--- a/xpcom/glue/moz.build
+++ b/xpcom/glue/moz.build
@@ -107,8 +107,10 @@ if CONFIG['_MSC_VER']:
     CXXFLAGS += ['-Zl']
 
 LOCAL_INCLUDES += [
     '../build',
 ]
 
 if CONFIG['ENABLE_TESTS']:
     DIRS += ['tests/gtest']
+
+FAIL_ON_WARNINGS = True
--- a/xpcom/glue/nomozalloc/moz.build
+++ b/xpcom/glue/nomozalloc/moz.build
@@ -35,8 +35,10 @@ LOCAL_INCLUDES += [
 
 # Pretend we're statically linking the CRT, even though we might not be: this
 # avoids "msvcrp" and assembly dependencies from creeping into the directives
 # for this library on Windows.
 USE_STATIC_LIBS = True
 
 # Don't use STL wrappers here (i.e. wrapped <new>); they require mozalloc
 DISABLE_STL_WRAPPING = True
+
+FAIL_ON_WARNINGS = True
--- a/xpcom/glue/pldhash.h
+++ b/xpcom/glue/pldhash.h
@@ -179,19 +179,22 @@ class PLDHashTable
 {
 private:
   const PLDHashTableOps* mOps;        /* Virtual operations; see below. */
   int16_t             mHashShift;     /* multiplicative hash shift */
   /*
    * |mRecursionLevel| is only used in debug builds, but is present in opt
    * builds to avoid binary compatibility problems when mixing DEBUG and
    * non-DEBUG components.  (Actually, even if it were removed,
-   * sizeof(PLDHashTable) wouldn't change, due to struct padding.)
+   * sizeof(PLDHashTable) wouldn't change, due to struct padding.) Make it
+   * protected to suppress -Wunused-private-field warnings in opt builds.
    */
+protected:
   mutable uint16_t    mRecursionLevel;/* used to detect unsafe re-entry */
+private:
   uint32_t            mEntrySize;     /* number of bytes in an entry */
   uint32_t            mEntryCount;    /* number of entries in table */
   uint32_t            mRemovedCount;  /* removed entry sentinels in table */
   uint32_t            mGeneration;    /* entry storage generation number */
   char*               mEntryStore;    /* entry storage */
 
 #ifdef PL_DHASHMETER
   struct PLDHashStats
--- a/xpcom/glue/standalone/moz.build
+++ b/xpcom/glue/standalone/moz.build
@@ -37,8 +37,10 @@ if CONFIG['_MSC_VER']:
 DEFINES['XPCOM_GLUE'] = True
 
 LOCAL_INCLUDES += [
     '../../build',
 ]
 
 # Don't use STL wrappers here (i.e. wrapped <new>); they require mozalloc
 DISABLE_STL_WRAPPING = True
+
+FAIL_ON_WARNINGS = True
--- a/xpcom/glue/standalone/staticruntime/moz.build
+++ b/xpcom/glue/standalone/staticruntime/moz.build
@@ -32,8 +32,10 @@ LOCAL_INCLUDES += [
     '../../../build',
 ]
 
 # Statically link to the CRT on Windows
 USE_STATIC_LIBS = True
 
 # Don't use STL wrappers here (i.e. wrapped <new>); they require mozalloc
 DISABLE_STL_WRAPPING = True
+
+FAIL_ON_WARNINGS = True
--- a/xpcom/glue/staticruntime/moz.build
+++ b/xpcom/glue/staticruntime/moz.build
@@ -30,8 +30,10 @@ LOCAL_INCLUDES += [
     '../../build',
 ]
 
 # Statically link to the CRT on Windows
 USE_STATIC_LIBS = True
 
 # Don't use STL wrappers here (i.e. wrapped <new>); they require mozalloc
 DISABLE_STL_WRAPPING = True
+
+FAIL_ON_WARNINGS = True