Bug 1330202 - Suppress cairo build warnings on Windows. r?lsalzman draft
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>
Mon, 05 Jun 2017 01:08:51 +0900
changeset 588751 66db7edda5018b37e0fce179a4bf03bdc65972cc
parent 588744 f59dce2fc94c60feb35d6ce4fca295efb091c2e6
child 631669 cc1b8deb47566d8cae1aeccb6492400f464449de
push id62145
push userVYV03354@nifty.ne.jp
push dateSun, 04 Jun 2017 16:09:46 +0000
reviewerslsalzman
bugs1330202
milestone55.0a1
Bug 1330202 - Suppress cairo build warnings on Windows. r?lsalzman MozReview-Commit-ID: BDWahhdAV8Z
gfx/cairo/cairo/src/moz.build
gfx/cairo/libpixman/src/moz.build
--- a/gfx/cairo/cairo/src/moz.build
+++ b/gfx/cairo/cairo/src/moz.build
@@ -230,16 +230,36 @@ if CONFIG['CLANG_CXX'] or CONFIG['CLANG_
         '-Wno-deprecated-register',
         '-Wno-incompatible-pointer-types',
         '-Wno-macro-redefined',
         '-Wno-tautological-compare',
         '-Wno-tautological-constant-out-of-range-compare',
         '-Wno-error=uninitialized',
     ]
 
+if CONFIG['_MSC_VER'] and not CONFIG['CLANG_CL']:
+    CFLAGS += [
+        '-wd4005', # 'WIN32_LEAN_AND_MEAN' : macro redefinition
+        '-wd4018', # '>' : signed/unsigned mismatch
+        '-wd4047', # different levels of indirection
+        '-wd4101', # unreferenced local variable
+        '-wd4133', # 'function' : incompatible types
+        '-wd4146', # unary minus operator applied to unsigned type
+        '-wd4311', # 'variable' : pointer truncation from 'type' to 'type'
+        '-wd4477', # format string '%s' requires an argument of type 'type'
+        '-wd4996', # The compiler encountered a deprecated declaration.
+    ]
+    CXXFLAGS += [
+        '-wd4005', # 'WIN32_LEAN_AND_MEAN' : macro redefinition
+        '-wd4018', # '>' : signed/unsigned mismatch
+        '-wd4146', # unary minus operator applied to unsigned type
+        '-wd4828', # illegal in the current source character set
+        '-wd4838', # requires a narrowing conversion
+    ]
+
 # See bug 386897.
 if CONFIG['GNU_CC'] and CONFIG['OS_TARGET'] == 'Android' and CONFIG['MOZ_OPTIMIZE']:
     CFLAGS += ['-O2']
     CXXFLAGS += ['-O2']
 
 if CONFIG['MOZ_X11']:
     CFLAGS += CONFIG['XCFLAGS']
 
--- a/gfx/cairo/libpixman/src/moz.build
+++ b/gfx/cairo/libpixman/src/moz.build
@@ -149,12 +149,20 @@ if CONFIG['CLANG_CXX'] or CONFIG['CLANG_
         '-Wno-incompatible-pointer-types',
         '-Wno-tautological-compare',
         '-Wno-tautological-constant-out-of-range-compare',
     ]
 if CONFIG['CLANG_CL']:
     CFLAGS += [
         '-Wno-unused-variable',
     ]
+if CONFIG['_MSC_VER'] and not CONFIG['CLANG_CL']:
+    CFLAGS += [
+        '-wd4047', # different levels of indirection
+        '-wd4101', # unreferenced local variable
+        '-wd4133', # 'function' : incompatible types
+        '-wd4146', # unary minus operator applied to unsigned type
+        '-wd4311', # 'variable' : pointer truncation from 'type' to 'type'
+    ]
 
 # See bug 386897.
 if CONFIG['OS_TARGET'] == 'Android' and CONFIG['MOZ_OPTIMIZE']:
     CFLAGS += ['-O2']