-
Notifications
You must be signed in to change notification settings - Fork 145
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 more Wconversion warnings #125
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small comment
@@ -47,7 +47,7 @@ void TestHelper::printTestName(bslstl::StringRef value) | |||
} | |||
|
|||
bsl::cout << "\n" << value << "\n"; | |||
int length = value.length(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently long unsigned int
is identical to size_t
, but for the future it's more safe to use size_t
here, as length()
returns. The reason is that size_t
has an explicit contract in its definition size_t can store the maximum size of a theoretically possible object of any type (including array).
https://en.cppreference.com/w/c/types/size_t
There are size_t
used in almost all similar cases in the codebase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed, thanks!
Signed-off-by: banipreetr <[email protected]>
Signed-off-by: banipreetr <[email protected]>
91545cf
to
7a7c8b2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@banipreetr thank you for the contribution! |
*Issue number of the reported bug or feature request: #87 *
Describe your changes
Follow up to #122, this PR contribution is to fix more -Wconversion warnings that pollutes the build log.
Testing performed
N/A
Additional context
Add any other context about your contribution here.