Bug 1393222 Disable the unused-function warning when compiling with gcc for Windows r?froydnj draft
authorTom Ritter <tom@mozilla.com>
Wed, 23 Aug 2017 16:08:30 -0500
changeset 655121 859677a7632708001e8c56eb5e8564bc61ee9c16
parent 655120 8d0c7e2d39876535b9a458ac51390f50609d662d
child 655122 af919c60f38c1ca5bffc5e7154ee5d38eece3e73
push id76778
push userbmo:tom@mozilla.com
push dateTue, 29 Aug 2017 17:35:26 +0000
reviewersfroydnj
bugs1393222
milestone57.0a1
Bug 1393222 Disable the unused-function warning when compiling with gcc for Windows r?froydnj In some cases, they are false positives. In other cases, the callsite is #ifdef-ed out, so it's a true positive, but not one we would correct. MozReview-Commit-ID: 6ThZH3wEXTp
build/moz.configure/warnings.configure
--- a/build/moz.configure/warnings.configure
+++ b/build/moz.configure/warnings.configure
@@ -109,16 +109,21 @@ check_and_add_gcc_warning('-Wformat')
 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'))
 
+# 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'))
+
 # 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')