Skip to content

stdlib: silence truncation warning on Windows #15919

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

Merged
merged 1 commit into from
Apr 13, 2018

Conversation

compnerd
Copy link
Member

The returned type std::streamoff on Windows x64 is a long long
rather than int. This results in a 64-to-32 bit shortening of the
value. Use the appropriate type to avoid the truncation.

strlen returns a unsigned value, but std::streamoff is an signed
value. Explicitly cast the value to avoid the warning about the
implicit signed conversion.

Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

Resolves SR-NNNN.

The returned type `std::streamoff` on Windows x64 is a `long long`
rather than `int`.  This results in a 64-to-32 bit shortening of the
value.  Use the appropriate type to avoid the truncation.

`strlen` returns a unsigned value, but `std::streamoff` is an signed
value.  Explicitly cast the value to avoid the warning about the
implicit signed conversion.
@compnerd
Copy link
Member Author

@swift-ci please test and merge

@swift-ci swift-ci merged commit 9231003 into swiftlang:master Apr 13, 2018
@compnerd compnerd deleted the truncation branch April 13, 2018 20:17
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