Skip to content

fix gcc warning when CXXFLAGS contains '-Wextra' #84

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

Closed
wants to merge 1 commit into from

Conversation

xiaoyur347
Copy link
Contributor

When CXXFLAGS contains '-Wextra', as I set
SET(CMAKE_CXX_FLAGS_RELEASE ‘-Wall -Wextra’)
in root CMakeLists.txt.
I got the following error:
json_value.cpp:179:26: warning: enumeral and non-enumeral type in conditional expression [enabled by default]

I have describe it in the closed pull as follows:
#80

Thanks the help of Christopher Dunn
"
Yours will be slightly less efficient. I know this CZString stuff is kind of hacky, but why not use static_cast(other.index_ == noDuplication ? noDuplication : duplicate) after the question mark?
"
I test the modification and it works fine.

json_value.cpp:179:26: warning: enumeral and non-enumeral type in conditional expression [enabled by default]
cdunn2001 pushed a commit that referenced this pull request Nov 20, 2014
json_value.cpp:179:26: warning: enumeral and non-enumeral type in conditional expression [enabled by default]

#84
@cdunn2001
Copy link
Contributor

Rebased and pulled. Thanks.

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

Successfully merging this pull request may close these issues.

2 participants