Fix warning 4373.
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 <mbonadei@webrtc.org>
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21691}
diff --git a/media/BUILD.gn b/media/BUILD.gn
index 9be093c..52092bf 100644
--- a/media/BUILD.gn
+++ b/media/BUILD.gn
@@ -560,7 +560,6 @@
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 95bb5b7..855f874 100644
--- a/modules/BUILD.gn
+++ b/modules/BUILD.gn
@@ -118,14 +118,6 @@
# 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 aeb9fd3..dc0c0ab 100644
--- a/modules/audio_device/BUILD.gn
+++ b/modules/audio_device/BUILD.gn
@@ -292,17 +292,6 @@
]
}
-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 @@
":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 2fe3cc2..5b08845 100644
--- a/modules/remote_bitrate_estimator/BUILD.gn
+++ b/modules/remote_bitrate_estimator/BUILD.gn
@@ -131,13 +131,6 @@
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 bf94013..c2dafe1 100644
--- a/modules/rtp_rtcp/BUILD.gn
+++ b/modules/rtp_rtcp/BUILD.gn
@@ -221,13 +221,6 @@
# 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 48dac93..d3dbcf6 100644
--- a/modules/video_coding/BUILD.gn
+++ b/modules/video_coding/BUILD.gn
@@ -707,12 +707,6 @@
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 d7a2e77..8eaaae3 100644
--- a/test/BUILD.gn
+++ b/test/BUILD.gn
@@ -149,10 +149,23 @@
}
}
+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 @@
# 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" ]