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

Fix comparison warnings caused by 54fc4e2 #1575

Merged

Conversation

JensMertelmeyer
Copy link
Contributor

The commit in 54fc4e2 introduces several warnings of "comparison of integer expressions of different signedness: 'unsigned int' and 'int'". Example:

src/./json/json_value.cpp: In instantiation of 'bool Json::InRange(double, T, U) [with T = int; U = unsigned int]':
src/./json/json_value.cpp:687:5:   required from here
src/./json/json_value.cpp:106:30: warning: comparison of integer expressions of different signedness: 'unsigned int' and 'int' [-Wsign-compare]
  106 |          !(static_cast<U>(d) == min && d != integerToDouble(min));
      |            ~~~~~~~~~~~~~~~~~~^~~~~~

This is because maxUInt is unsigned while the 0 literal is not.
I replaced them with 0u and it looks fine again.

@baylesj baylesj merged commit dca8a24 into open-source-parsers:master Dec 5, 2024
10 checks passed
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