Skip to content

Commit 035a101

Browse files
committed
Suppress unused-value warning
When _DEBUG is not defined the _CrtSetDbgFlag turns into ((int)0), which causes unused-value warning for clang.
1 parent 1a3e2a2 commit 035a101

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

googletest/src/gtest-port.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,12 +377,12 @@ class MemoryIsNotDeallocated
377377
old_crtdbg_flag_ = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
378378
// Set heap allocation block type to _IGNORE_BLOCK so that MS debug CRT
379379
// doesn't report mem leak if there's no matching deallocation.
380-
_CrtSetDbgFlag(old_crtdbg_flag_ & ~_CRTDBG_ALLOC_MEM_DF);
380+
(void)_CrtSetDbgFlag(old_crtdbg_flag_ & ~_CRTDBG_ALLOC_MEM_DF);
381381
}
382382

383383
~MemoryIsNotDeallocated() {
384384
// Restore the original _CRTDBG_ALLOC_MEM_DF flag
385-
_CrtSetDbgFlag(old_crtdbg_flag_);
385+
(void)_CrtSetDbgFlag(old_crtdbg_flag_);
386386
}
387387

388388
private:

0 commit comments

Comments
 (0)