Commit 5bf76bb4 authored by 's avatar

Avoid warning for type punning like

src/logging_unittest.cc:591: warning: dereferencing type-punned pointer will break strict-aliasing rules

As we'll never dereference the casted pointers, it's OK to silence this warning.


git-svn-id: https://google-glog.googlecode.com/svn/trunk@67 eb4d4688-79bd-11dd-afb4-1d65580434c0
parent fcbeeb9f
...@@ -586,10 +586,10 @@ TEST(CheckNOTNULL, Simple) { ...@@ -586,10 +586,10 @@ TEST(CheckNOTNULL, Simple) {
void *ptr = static_cast<void *>(&t); void *ptr = static_cast<void *>(&t);
void *ref = CHECK_NOTNULL(ptr); void *ref = CHECK_NOTNULL(ptr);
EXPECT_EQ(ptr, ref); EXPECT_EQ(ptr, ref);
CHECK_NOTNULL(reinterpret_cast<char *>(&t)); CHECK_NOTNULL(reinterpret_cast<char *>(ptr));
CHECK_NOTNULL(reinterpret_cast<unsigned char *>(&t)); CHECK_NOTNULL(reinterpret_cast<unsigned char *>(ptr));
CHECK_NOTNULL(reinterpret_cast<int *>(&t)); CHECK_NOTNULL(reinterpret_cast<int *>(ptr));
CHECK_NOTNULL(reinterpret_cast<int64 *>(&t)); CHECK_NOTNULL(reinterpret_cast<int64 *>(ptr));
} }
TEST(DeathCheckNN, Simple) { TEST(DeathCheckNN, Simple) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment