Bug 1393216 Disable unknown pragma warnings when compiling for Windows with gcc r?froydnj draft
authorTom Ritter <tom@mozilla.com>
Wed, 23 Aug 2017 16:18:28 -0500
changeset 651586 f2e19b679391e227eaabdd20e0618d9c755ea99b
parent 651585 914ad2219fd249c505c39b94b677af4092f736f2
child 727825 e010e9c1fb93b482e6634a3f4e91df1cf7ed2d21
push id75769
push userbmo:tom@mozilla.com
push dateWed, 23 Aug 2017 21:19:08 +0000
reviewersfroydnj
bugs1393216
milestone57.0a1
Bug 1393216 Disable unknown pragma warnings when compiling for Windows with gcc r?froydnj MozReview-Commit-ID: 6cZ96xe4h8C
build/moz.configure/warnings.configure
old mode 100644
new mode 100755
--- a/build/moz.configure/warnings.configure
+++ b/build/moz.configure/warnings.configure
@@ -104,16 +104,21 @@ 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'))
+
 # 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')