Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXPECT_EQ(kFalseConstant, ...) issues warning with GCC 4.7 and higher #458

Closed
GoogleCodeExporter opened this issue Jul 28, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link
Contributor

For example if we have:
const bool kFalseConstant = false;
EXPECT_EQ(kFalseConstant, foo());

GCC 4.7 will issue the following warning:
converting 'false' to pointer type for argument 1 of 'char 
testing::internal::IsNullLiteralHelper(testing::internal::Secret*)'

We are using the following workaround in Chromium:
EXPECT_TRUE(kFalseConstant == foo());

Though I'm not sure if it the expected behavior to consider kFalseConstant as 
compatible to null pointer. (why EXPECT_EQ has to check that anyway?) It may be 
a bug or not.

Original issue reported on code.google.com by trc...@chromium.org on 16 May 2014 at 11:38

@GoogleCodeExporter
Copy link
Contributor Author

Is it a duplication of https://code.google.com/p/googletest/issues/detail?id=322

Original comment by marc...@gmail.com on 17 Jul 2015 at 9:13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants