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
--- 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