aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGennadiy Civil <gennadiycivil@users.noreply.github.com>2018-01-03 14:10:29 -0500
committerGitHub <noreply@github.com>2018-01-03 14:10:29 -0500
commit88760a299f56a935fa41797bf471d5950cbf541e (patch)
tree206ce12d1f5b7ae5841c05733119bc306e725655
parent1414d71af0c0f5a37df8d02972d304828bb6800e (diff)
parentfa6730103ecaad750f42700c55a92c3e212a9271 (diff)
downloadgoogletest-88760a299f56a935fa41797bf471d5950cbf541e.tar.gz
googletest-88760a299f56a935fa41797bf471d5950cbf541e.tar.bz2
googletest-88760a299f56a935fa41797bf471d5950cbf541e.zip
Merge pull request #991 from davidben/uintptr
Pass MSVC's C4826 warning.
-rw-r--r--googletest/include/gtest/gtest-printers.h9
1 files changed, 2 insertions, 7 deletions
diff --git a/googletest/include/gtest/gtest-printers.h b/googletest/include/gtest/gtest-printers.h
index 282a2dac..38c63d25 100644
--- a/googletest/include/gtest/gtest-printers.h
+++ b/googletest/include/gtest/gtest-printers.h
@@ -427,13 +427,8 @@ void DefaultPrintTo(WrapPrinterType<kPrintFunctionPointer> /* dummy */,
*os << "NULL";
} else {
// T is a function type, so '*os << p' doesn't do what we want
- // (it just prints p as bool). We want to print p as a const
- // void*. However, we cannot cast it to const void* directly,
- // even using reinterpret_cast, as earlier versions of gcc
- // (e.g. 3.4.5) cannot compile the cast when p is a function
- // pointer. Casting to UInt64 first solves the problem.
- *os << reinterpret_cast<const void*>(
- reinterpret_cast<internal::UInt64>(p));
+ // (it just prints p as bool). Cast p to const void* to print it.
+ *os << reinterpret_cast<const void*>(p);
}
}