From 34924c236c402c3c9961514b78bd2ce6b454df7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrik=20H=C3=B6glund?= Date: Fri, 19 Jan 2018 09:11:07 +0100 Subject: [PATCH] Fix warning 4373. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Looks like all the current warnings were because of a MSVC bug: https://github.com/google/googletest/blob/master/googlemock/docs/FrequentlyAskedQuestions.md We can just disable this one for all tests and be done with it. Bug: webrtc:261 Change-Id: I882a577f832ff71ac61936abebe0ca537088bab8 Reviewed-on: https://webrtc-review.googlesource.com/40840 Reviewed-by: Mirko Bonadei Commit-Queue: Patrik Höglund Cr-Commit-Position: refs/heads/master@{#21691} --- media/BUILD.gn | 1 - modules/BUILD.gn | 8 -------- modules/audio_device/BUILD.gn | 12 ------------ modules/remote_bitrate_estimator/BUILD.gn | 7 ------- modules/rtp_rtcp/BUILD.gn | 7 ------- modules/video_coding/BUILD.gn | 6 ------ test/BUILD.gn | 18 +++++++++++++----- 7 files changed, 13 insertions(+), 46 deletions(-) diff --git a/media/BUILD.gn b/media/BUILD.gn index 9be093c34d..52092bfa07 100644 --- a/media/BUILD.gn +++ b/media/BUILD.gn @@ -560,7 +560,6 @@ if (rtc_include_tests) { if (is_win) { cflags = [ "/wd4245", # conversion from int to size_t, signed/unsigned mismatch. - "/wd4373", # virtual function override. "/wd4389", # signed/unsigned mismatch. ] } diff --git a/modules/BUILD.gn b/modules/BUILD.gn index 95bb5b7a87..855f8741a6 100644 --- a/modules/BUILD.gn +++ b/modules/BUILD.gn @@ -118,14 +118,6 @@ if (rtc_include_tests) { # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] } - if (is_win) { - cflags = [ - # TODO(phoglund): get rid of 4373 supression when - # http://code.google.com/p/webrtc/issues/detail?id=261 is solved. - # legacy warning for ignoring const / volatile in signatures. - "/wd4373", - ] - } } modules_unittests_resources = [ diff --git a/modules/audio_device/BUILD.gn b/modules/audio_device/BUILD.gn index aeb9fd3d9a..dc0c0abe6c 100644 --- a/modules/audio_device/BUILD.gn +++ b/modules/audio_device/BUILD.gn @@ -292,17 +292,6 @@ rtc_source_set("mac_portaudio") { ] } -config("mock_audio_device_config") { - if (is_win) { - cflags = [ - # TODO(phoglund): get rid of 4373 supression when - # http://code.google.com/p/webrtc/issues/detail?id=261 is solved. - # legacy warning for ignoring const / volatile in signatures. - "/wd4373", - ] - } -} - rtc_source_set("mock_audio_device") { testonly = true sources = [ @@ -314,7 +303,6 @@ rtc_source_set("mock_audio_device") { ":audio_device", "../../test:test_support", ] - all_dependent_configs = [ ":mock_audio_device_config" ] } if (rtc_include_tests) { diff --git a/modules/remote_bitrate_estimator/BUILD.gn b/modules/remote_bitrate_estimator/BUILD.gn index 2fe3cc2bf5..5b088459a7 100644 --- a/modules/remote_bitrate_estimator/BUILD.gn +++ b/modules/remote_bitrate_estimator/BUILD.gn @@ -131,13 +131,6 @@ if (rtc_include_tests) { suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] } - if (is_win) { - cflags = [ - # TODO(kjellander): Bug 261: fix this warning. - "/wd4373", # virtual function override. - ] - } - deps = [ ":remote_bitrate_estimator", "..:module_api", diff --git a/modules/rtp_rtcp/BUILD.gn b/modules/rtp_rtcp/BUILD.gn index bf94013bf8..c2dafe1223 100644 --- a/modules/rtp_rtcp/BUILD.gn +++ b/modules/rtp_rtcp/BUILD.gn @@ -221,13 +221,6 @@ rtc_static_library("rtp_rtcp") { # TODO(jschuh): Bug 1348: fix this warning. configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] - - if (is_win) { - cflags = [ - # TODO(kjellander): Bug 261: fix this warning. - "/wd4373", # virtual function override. - ] - } } rtc_source_set("rtcp_transceiver") { diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn index 48dac93bd9..d3dbcf6277 100644 --- a/modules/video_coding/BUILD.gn +++ b/modules/video_coding/BUILD.gn @@ -707,12 +707,6 @@ if (rtc_include_tests) { if (rtc_build_libvpx) { deps += [ rtc_libvpx_dir ] } - if (is_win) { - cflags = [ - # TODO(kjellander): bugs.webrtc.org/261: Fix this warning. - "/wd4373", # virtual function override. - ] - } # TODO(jschuh): bugs.webrtc.org/1348: fix this warning. configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] diff --git a/test/BUILD.gn b/test/BUILD.gn index d7a2e77284..8eaaae3b82 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -149,10 +149,23 @@ if (is_ios) { } } +config("suppress_warning_4373") { + if (is_win) { + cflags = [ + # MSVC has a bug which generates this warning when using mocks; see the + # section on warning 4373 in he googlemock FAQ. This warning isn't the + # least relevant for us, anyway. + "/wd4373", + ] + } +} + rtc_source_set("test_support") { visibility = [ "*" ] testonly = true + all_dependent_configs = [ ":suppress_warning_4373" ] + sources = [ "gmock.h", "gtest.h", @@ -344,11 +357,6 @@ if (rtc_include_tests) { # TODO(jschuh): Bug 1348: fix this warning. configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] - if (is_win) { - # virtual override w/different const/volatile signature. - cflags = [ "/wd4373" ] - } - if (!build_with_chromium && is_clang) { # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]