From 0f942010a9bf8c335e5818b2ca228266b42cc725 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Sat, 8 Aug 2015 10:38:55 -0700 Subject: [PATCH] clang/win: Build chromium_code with -Wunused-function BUG=505316 R=dalecurtis@chromium.org, dcheng@chromium.org, robertshield@chromium.org Review URL: https://codereview.chromium.org/1261953003. Cr-Commit-Position: refs/heads/master@{#342535} --- build/common.gypi | 4 +++- build/config/compiler/BUILD.gn | 5 ++++- media/audio/win/audio_device_listener_win.cc | 21 --------------------- win8/metro_driver/metro_driver.cc | 2 ++ 4 files changed, 9 insertions(+), 23 deletions(-) diff --git a/build/common.gypi b/build/common.gypi index 70ea06c41abc..586dc2140567 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -3148,6 +3148,9 @@ # TODO(mgiuca): Move this suppression into individual third-party # libraries as required. http://crbug.com/505301. '-Wno-overloaded-virtual', + # TODO(thakis): Move this suppression into individual third-party + # libraries as required. http://crbug.com/505316. + '-Wno-unused-function', # Lots of third-party libraries have unused variables. Instead of # suppressing them individually, we just blanket suppress them here. '-Wno-unused-variable', @@ -5803,7 +5806,6 @@ '-Wno-microsoft', # http://crbug.com/505296 '-Wno-switch', # http://crbug.com/505308 '-Wno-unknown-pragmas', # http://crbug.com/505314 - '-Wno-unused-function', # http://crbug.com/505316 '-Wno-unused-value', # http://crbug.com/505318 ], }, diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index cbdef8a8a5cf..560e8ee6b0cc 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn @@ -849,7 +849,6 @@ if (is_win) { "-Wno-microsoft", # http://crbug.com/505296 "-Wno-switch", # http://crbug.com/505308 "-Wno-unknown-pragmas", # http://crbug.com/505314 - "-Wno-unused-function", # http://crbug.com/505316 "-Wno-unused-value", # http://crbug.com/505318 ] } @@ -1042,6 +1041,10 @@ config("no_chromium_code") { # libraries as required. http://crbug.com/505301. "-Wno-overloaded-virtual", + # TODO(thakis): Move this suppression into individual third-party + # libraries as required. http://crbug.com/505316. + "-Wno-unused-function", + # Lots of third-party libraries have unused variables. Instead of # suppressing them individually, we just blanket suppress them here. "-Wno-unused-variable", diff --git a/media/audio/win/audio_device_listener_win.cc b/media/audio/win/audio_device_listener_win.cc index 4af85a0fb4bc..505007bae37f 100644 --- a/media/audio/win/audio_device_listener_win.cc +++ b/media/audio/win/audio_device_listener_win.cc @@ -31,27 +31,6 @@ static std::string RoleToString(ERole role) { } } -static std::string GetDeviceId(EDataFlow flow, - ERole role) { - ScopedComPtr device = - CoreAudioUtil::CreateDefaultDevice(flow, role); - if (!device.get()) { - // Most probable reason for ending up here is that all audio devices are - // disabled or unplugged. - DVLOG(1) << "CoreAudioUtil::CreateDefaultDevice failed. No device?"; - return std::string(); - } - - AudioDeviceName device_name; - HRESULT hr = CoreAudioUtil::GetDeviceName(device.get(), &device_name); - if (FAILED(hr)) { - DVLOG(1) << "Failed to retrieve the device id: " << std::hex << hr; - return std::string(); - } - - return device_name.unique_id; -} - AudioDeviceListenerWin::AudioDeviceListenerWin(const base::Closure& listener_cb) : listener_cb_(listener_cb), tick_clock_(new base::DefaultTickClock()) { CHECK(CoreAudioUtil::IsSupported()); diff --git a/win8/metro_driver/metro_driver.cc b/win8/metro_driver/metro_driver.cc index 4eedfdc0ae31..650b23837612 100644 --- a/win8/metro_driver/metro_driver.cc +++ b/win8/metro_driver/metro_driver.cc @@ -18,6 +18,7 @@ namespace { +#if !defined(NDEBUG) LONG WINAPI ErrorReportingHandler(EXCEPTION_POINTERS* ex_info) { // See roerrorapi.h for a description of the // exception codes and parameters. @@ -34,6 +35,7 @@ LONG WINAPI ErrorReportingHandler(EXCEPTION_POINTERS* ex_info) { return EXCEPTION_CONTINUE_SEARCH; } +#endif void SetMetroReportingFlags() { #if !defined(NDEBUG) -- 2.11.4.GIT