Bug 1407343 Silence multiple classes of annoying warnings
MozReview-Commit-ID: I0PvrH4Zy33
--- a/build/moz.configure/warnings.configure
+++ b/build/moz.configure/warnings.configure
@@ -108,25 +108,51 @@ check_and_add_gcc_warning('-Wno-error=fr
# catches format/argument mismatches with printf
check_and_add_gcc_warning('-Wformat')
# We use mix of both POSIX and Win32 printf format across the tree, so format
# warnings are useless on mingw.
check_and_add_gcc_warning('-Wno-format',
when=depends(target)(lambda t: t.kernel == 'WINNT'))
-# When compiling for Windows with gcc, we encounter lots of "#pragma warning"'s
-# which is an MSVC-only pragma that GCC does not recognize.
-check_and_add_gcc_warning('-Wno-unknown-pragmas',
- when=depends(target)(lambda t: t.kernel == 'WINNT'))
+# Other MinGW specific things
+with only_when(depends(target)(lambda t: t.kernel == 'WINNT')):
+ # When compiling for Windows with gcc, we encounter lots of "#pragma warning"'s
+ # which is an MSVC-only pragma that GCC does not recognize.
+ check_and_add_gcc_warning('-Wno-unknown-pragmas')
+
+ # When compiling for Windows with gcc, gcc throws false positives and true
+ # positives where the callsite is ifdef-ed out
+ check_and_add_gcc_warning('-Wno-unused-function')
+
+ # When compiling for Windows with gcc, gcc cannot produce this warning
+ # correctly, it mistakes DWORD_PTR and ULONG_PTR as types you cannot
+ # give NULL to. (You can in fact do that.)
+ check_and_add_gcc_warning('-Wno-conversion-null')
-# When compiling for Windows with gcc, gcc throws false positives and true
-# positives where the callsite is ifdef-ed out
-check_and_add_gcc_warning('-Wno-unused-function',
- when=depends(target)(lambda t: t.kernel == 'WINNT'))
+ # For now, silence low priority gcc warnings globally
+ check_and_add_gcc_warning('-Wno-unused-value')
+ check_and_add_gcc_warning('-Wno-unused-variable')
+ check_and_add_gcc_warning('-Wno-unused-but-set-variable')
+
+ # Warn whenever a comment-start sequence ‘/*’ appears in a ‘/*’ comment, or
+ # whenever a backslash-newline appears in a ‘//’ comment.
+ check_and_add_gcc_warning('-Wno-comment')
+ # Warn whenever a switch statement has an index of enumerated type and lacks
+ # a case for one or more of the named codes of that enumeration.
+ check_and_add_gcc_warning('-Wno-switch')
+ # When compiling C, give string constants the type const char[length] so that
+ # copying the address of one into a non-const char * pointer produces a warning.
+ check_and_add_gcc_warning('-Wno-write-strings')
+ # Warn if the return type of a function has a type qualifier such as const
+ check_and_add_gcc_warning('-Wno-ignored-qualifiers')
+ # Warn if parentheses are omitted in certain contexts
+ check_and_add_gcc_warning('-Wno-parentheses')
+ # Warn about a comparison between values of different enumerated types
+ check_and_add_gcc_warning('-Wno-enum-compare')
# We hit this all over the place with the gtest INSTANTIATE_TEST_CASE_P macro
check_and_add_gcc_warning('-Wno-gnu-zero-variadic-macro-arguments')
# Add compile-time warnings for unprotected functions and format functions
# that represent possible security problems
check_and_add_gcc_warning('-Wformat-security')
check_and_add_gcc_warning('-Wformat-overflow=2')