Bug 1400705 - cairo: Fix -Wunknown-warning-option clang warning about gcc flag (and suppress some other warnings). r?lsalzman draft
authorChris Peterson <cpeterson@mozilla.com>
Sat, 16 Sep 2017 21:01:25 -0700
changeset 666089 51b8bcb7a41f3b3d6d2d1c4e7113e51f5318c16b
parent 666088 0408418cdef3a7ed4f72cdaaf5540b07b70021fd
child 731972 3518fc1b3d8fa2e4d6f3461fe7ac9b2e3ac1084f
push id80270
push usercpeterson@mozilla.com
push dateSun, 17 Sep 2017 19:40:22 +0000
reviewerslsalzman
bugs1400705
milestone57.0a1
Bug 1400705 - cairo: Fix -Wunknown-warning-option clang warning about gcc flag (and suppress some other warnings). r?lsalzman * The -Wno-unused-but-set-variable flag is supported by gcc but not clang, so move it to a gcc-only CFLAGS. * The -Wno-error=uninitialized flag is supported by both gcc and clang, so move it to CFLAGS shared by gcc and clang. * Also suppress -Wunreachable-code and -Wshift-negative-value clang warnings. gcc supports -Wshift-negative-value, but only starting in gcc 6.1 and we are still using gcc 4.9 in automation. warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Wunknown-warning-option] gfx/cairo/cairo/src/cairo-quartz-surface.c:1908:6: warning: code will never be executed [-Wunreachable-code] gfx/cairo/libpixman/src/pixman-bits-image.c:268:32: warning: shifting a negative signed value is undefined [-Wshift-negative-value] MozReview-Commit-ID: AnQAsfDaZbk
gfx/cairo/cairo/src/moz.build
--- a/gfx/cairo/cairo/src/moz.build
+++ b/gfx/cairo/cairo/src/moz.build
@@ -222,29 +222,31 @@ if CONFIG['GNU_CC'] or CONFIG['CLANG_CL'
         '-Wno-sign-compare',
         '-Wno-type-limits',
         '-Wno-missing-field-initializers',
         '-Wno-conversion',
         '-Wno-narrowing',
         '-Wno-switch',
         '-Wno-unused',
         '-Wno-unused-variable',
-        '-Wno-unused-but-set-variable'
-    ]
-
-if CONFIG['CLANG_CXX'] or CONFIG['CLANG_CL']:
-    CFLAGS += [
-        '-Wno-absolute-value',
-        '-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['CLANG_CXX'] or CONFIG['CLANG_CL']:
+        CFLAGS += [
+            '-Wno-absolute-value',
+            '-Wno-deprecated-register',
+            '-Wno-incompatible-pointer-types',
+            '-Wno-macro-redefined',
+            '-Wno-shift-negative-value',
+            '-Wno-tautological-compare',
+            '-Wno-tautological-constant-out-of-range-compare',
+            '-Wno-unreachable-code',
+        ]
+    else:
+        CFLAGS += ['-Wno-unused-but-set-variable']
 
 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