From 035a101b62b144655d771c3a252e4cd52bde19a2 Mon Sep 17 00:00:00 2001 From: Denis Samoilov Date: Tue, 16 Nov 2021 18:59:03 -0800 Subject: [PATCH] Suppress unused-value warning When _DEBUG is not defined the _CrtSetDbgFlag turns into ((int)0), which causes unused-value warning for clang. --- googletest/src/gtest-port.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/googletest/src/gtest-port.cc b/googletest/src/gtest-port.cc index a34c1c9a..d47550ae 100644 --- a/googletest/src/gtest-port.cc +++ b/googletest/src/gtest-port.cc @@ -377,12 +377,12 @@ class MemoryIsNotDeallocated old_crtdbg_flag_ = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); // Set heap allocation block type to _IGNORE_BLOCK so that MS debug CRT // doesn't report mem leak if there's no matching deallocation. - _CrtSetDbgFlag(old_crtdbg_flag_ & ~_CRTDBG_ALLOC_MEM_DF); + (void)_CrtSetDbgFlag(old_crtdbg_flag_ & ~_CRTDBG_ALLOC_MEM_DF); } ~MemoryIsNotDeallocated() { // Restore the original _CRTDBG_ALLOC_MEM_DF flag - _CrtSetDbgFlag(old_crtdbg_flag_); + (void)_CrtSetDbgFlag(old_crtdbg_flag_); } private: