Bug 1237151 (part 4) - Turn on -Wignored-qualifiers for C++ code. r=mshal.
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 05 Jan 2016 14:31:02 -0800
changeset 316086 01908255691fb869756ce0e16caea539e2a87bd6
parent 316085 fd2b9869729288b7e236410a45b45e80ba4c7ad6
child 316087 312ccc646df37162e7489c6518b68fa2aff8a826
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)
reviewersmshal
bugs1237151
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 1237151 (part 4) - Turn on -Wignored-qualifiers for C++ code. r=mshal. It's already on for C code.
configure.in
js/src/configure.in
tools/profiler/moz.build
--- a/configure.in
+++ b/configure.in
@@ -1443,17 +1443,17 @@ if test "$GNU_CC"; then
         fi
     fi
 
     # Turn on gcc/clang warnings:
     # https://gcc.gnu.org/onlinedocs/gcc-4.7.2/gcc/Warning-Options.html
 
     # -Wall - lots of useful warnings
     # -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives
-    # -Wignored-qualifiers - catches returns types with qualifiers like const
+    # -Wignored-qualifiers - catches return types with qualifiers like const
     # -Wpointer-arith - catches pointer arithmetic using NULL or sizeof(void)
     # -Wtype-limits - catches overflow bugs, few false positives
     _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall"
     _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wempty-body"
     _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wignored-qualifiers"
     _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wpointer-arith"
     _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wtype-limits"
 
@@ -1525,21 +1525,23 @@ if test "$GNU_CXX"; then
     # FIXME: Let us build with strict aliasing. bug 414641.
     CXXFLAGS="$CXXFLAGS -fno-exceptions -fno-strict-aliasing"
 
     # Turn on gcc/clang warnings:
     # https://gcc.gnu.org/onlinedocs/gcc-4.7.2/gcc/Warning-Options.html
 
     # -Wall - lots of useful warnings
     # -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives
+    # -Wignored-qualifiers - catches return types with qualifiers like const
     # -Woverloaded-virtual - function declaration hides virtual function from base class
     # -Wpointer-arith - catches pointer arithmetic using NULL or sizeof(void)
     # -Wtype-limits - catches overflow bugs, few false positives
     _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall"
     _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wempty-body"
+    _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wignored-qualifiers"
     _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Woverloaded-virtual"
     _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wpointer-arith"
     _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wtype-limits"
 
     # -Wnon-literal-null-conversion - catches expressions used as a null pointer constant
     # -Wrange-loop-analysis - catches copies during range-based for loops.
     # -Wsometimes-initialized - catches some uninitialized values
     # -Wunreachable-code - catches some dead code
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -1186,17 +1186,17 @@ if test "$GNU_CC"; then
                   AC_MSG_RESULT([no])
                   LDFLAGS=$_SAVE_LDFLAGS)
 
     # Turn on gcc/clang warnings:
     # https://gcc.gnu.org/onlinedocs/gcc-4.7.2/gcc/Warning-Options.html
 
     # -Wall - lots of useful warnings
     # -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives
-    # -Wignored-qualifiers - catches returns types with qualifiers like const
+    # -Wignored-qualifiers - catches return types with qualifiers like const
     # -Wpointer-arith - catches pointer arithmetic using NULL or sizeof(void)
     # -Wtype-limits - catches overflow bugs, few false positives
     _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall"
     _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wempty-body"
     _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wignored-qualifiers"
     _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wpointer-arith"
     _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wtype-limits"
 
@@ -1263,21 +1263,23 @@ else
 fi
 
 if test "$GNU_CXX"; then
     # Turn on gcc/clang warnings:
     # https://gcc.gnu.org/onlinedocs/gcc-4.7.2/gcc/Warning-Options.html
 
     # -Wall - lots of useful warnings
     # -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives
+    # -Wignored-qualifiers - catches return types with qualifiers like const
     # -Woverloaded-virtual - function declaration hides virtual function from base class
     # -Wpointer-arith - catches pointer arithmetic using NULL or sizeof(void)
     # -Wtype-limits - catches overflow bugs, few false positives
     _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall"
     _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wempty-body"
+    _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wignored-qualifiers"
     _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Woverloaded-virtual"
     _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wpointer-arith"
     _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wtype-limits"
 
     # -Wclass-varargs - ???
     # -Wnon-literal-null-conversion - catches expressions used as a null pointer constant
     # -Wrange-loop-analysis - catches copies during range-based for loops.
     # -Wsometimes-initialized - catches some uninitialized values
--- a/tools/profiler/moz.build
+++ b/tools/profiler/moz.build
@@ -126,8 +126,11 @@ if CONFIG['MOZ_TASK_TRACER']:
         'tasktracer/TracedTaskCommon.h',
     ]
     UNIFIED_SOURCES += [
         'tasktracer/GeckoTaskTracer.cpp',
         'tasktracer/TracedTaskCommon.cpp',
     ]
 
 XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell.ini']
+
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wno-ignored-qualifiers']  # due to use of breakpad headers