summaryrefslogtreecommitdiffstats
path: root/googletest/src/gtest-port.cc
diff options
context:
space:
mode:
authorDenis Samoilov <denis.samoylov@intel.com>2021-11-17 02:59:03 (GMT)
committerDenis Samoilov <denis.samoylov@intel.com>2021-11-17 03:07:19 (GMT)
commit035a101b62b144655d771c3a252e4cd52bde19a2 (patch)
treef5067718d483f8d04140578d9e5499abd0aaf785 /googletest/src/gtest-port.cc
parent1a3e2a265f35e604378156cd675b11ef0a184627 (diff)
downloadgoogletest-035a101b62b144655d771c3a252e4cd52bde19a2.zip
googletest-035a101b62b144655d771c3a252e4cd52bde19a2.tar.gz
googletest-035a101b62b144655d771c3a252e4cd52bde19a2.tar.bz2
Suppress unused-value warningrefs/pull/3672/head
When _DEBUG is not defined the _CrtSetDbgFlag turns into ((int)0), which causes unused-value warning for clang.
Diffstat (limited to 'googletest/src/gtest-port.cc')
-rw-r--r--googletest/src/gtest-port.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/googletest/src/gtest-port.cc b/googletest/src/gtest-port.cc
index a34c1c9..d47550a 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: