From 5cd4f7a2be87749d96589486eb054c7da1e55bac Mon Sep 17 00:00:00 2001 From: thakis Date: Tue, 25 Nov 2014 12:23:35 -0800 Subject: clang: Suppress a few -Wstring-conversion warnings in 3rd-party code. The warning got stricter recently. BUG=82385 TBR=brettw Review URL: https://codereview.chromium.org/758963003 Cr-Commit-Position: refs/heads/master@{#305685} --- net/third_party/nss/ssl.gyp | 6 ++++++ net/third_party/nss/ssl/BUILD.gn | 13 +++++-------- third_party/mesa/BUILD.gn | 5 +++++ third_party/mesa/mesa.gyp | 6 ++++++ 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/net/third_party/nss/ssl.gyp b/net/third_party/nss/ssl.gyp index d6e2253..64d8551 100644 --- a/net/third_party/nss/ssl.gyp +++ b/net/third_party/nss/ssl.gyp @@ -79,6 +79,12 @@ 'USE_UTIL_DIRECTLY', ], 'msvs_disabled_warnings': [4018, 4244, 4267], + 'variables': { + 'clang_warning_flags_unset': [ + # ssl uses PR_ASSERT(!"foo") instead of PR_ASSERT(false && "foo") + '-Wstring-conversion', + ], + }, 'conditions': [ ['component == "shared_library"', { 'conditions': [ diff --git a/net/third_party/nss/ssl/BUILD.gn b/net/third_party/nss/ssl/BUILD.gn index b8fe40f..c958c13 100644 --- a/net/third_party/nss/ssl/BUILD.gn +++ b/net/third_party/nss/ssl/BUILD.gn @@ -8,14 +8,6 @@ config("ssl_config") { if (is_mac || is_win) { defines = [ "NSS_PLATFORM_CLIENT_AUTH" ] } - - if (is_clang) { - cflags = [ - # There is a broken header guard in /usr/include/nss/secmod.h: - # https://bugzilla.mozilla.org/show_bug.cgi?id=884072 - "-Wno-header-guard", - ] - } } component("libssl") { @@ -105,6 +97,11 @@ component("libssl") { libs = [ "Security.framework" ] } + if (is_clang) { + # SSL triggers some of these Clang warnings. + configs -= [ "//build/config/clang:extra_warnings" ] + } + if (is_posix) { sources -= [ "win32err.c", diff --git a/third_party/mesa/BUILD.gn b/third_party/mesa/BUILD.gn index 48b772c..511525a 100644 --- a/third_party/mesa/BUILD.gn +++ b/third_party/mesa/BUILD.gn @@ -679,6 +679,11 @@ shared_library("osmesa") { include_dirs = [ "src/src/mesa/drivers" ] + if (is_clang) { + # Mesa triggers some of these Clang warnings. + configs -= [ "//build/config/clang:extra_warnings" ] + } + deps = [ ":mesa_headers", ":mesa", diff --git a/third_party/mesa/mesa.gyp b/third_party/mesa/mesa.gyp index bc115e1..3db0d4c 100644 --- a/third_party/mesa/mesa.gyp +++ b/third_party/mesa/mesa.gyp @@ -700,6 +700,12 @@ 'src/src/mesa/drivers/osmesa/osmesa.c', 'src/src/mesa/drivers/osmesa/osmesa.def', ], + 'variables': { + 'clang_warning_flags_unset': [ + # Don't warn about string->bool used in asserts. + '-Wstring-conversion', + ], + }, }, ], 'conditions': [ -- cgit v1.1