Skip to content

Match types when calculating remaining in FileHandle's _readDataOfLength #1119

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

Conversation

gonzalolarralde
Copy link
Contributor

This was causing an error when trying to get the remaining amount of data.

@mattrajca
Copy link
Contributor

Can you add a test for this?

@pushkarnk
Copy link
Member

Per this the st_size member is also of type off_t. Am I missing something here?

@gonzalolarralde
Copy link
Contributor Author

@mattrajca @pushkarnk sorry for the lack of context in the original message.

@pushkarnk it is true for linux, it is not for 32-bits arm or at least in bionic. This is causing a compilation error when trying to combine a long long with an off_t without casting.

@mattrajca this wasn't causing a runtime error but a compilation error under some particular circumstances (-target armv7-linux-androideabi in my case)

@parkera
Copy link
Contributor

parkera commented Jul 18, 2017

@swift-ci please test

@parkera
Copy link
Contributor

parkera commented Jul 18, 2017

Let's see if this causes a compilation error on other platforms...

@pushkarnk
Copy link
Member

I think we can merge this. It seems to be blocking compilation of Foundation on the said platform. On platforms where st_size is of type off_t (where a cast isn't necessary), I don't think this explicit cast should cause a problem.

@pushkarnk
Copy link
Member

@swift-ci please test and merge

@swift-ci swift-ci merged commit 4c6e9a2 into swiftlang:master Jul 27, 2017
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.

5 participants