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 compatability for Xcode 11 #2744

Merged
merged 1 commit into from
Jun 5, 2019
Merged

fix compatability for Xcode 11 #2744

merged 1 commit into from
Jun 5, 2019

Conversation

dvshelley
Copy link

@dvshelley dvshelley commented Jun 4, 2019

New Pull Request Checklist

  • [ x] I have read and understood the CONTRIBUTING guide

  • [x ] I have read the Documentation

  • [ x] I have searched for a similar pull request in the project and found none

  • [x ] I have updated this branch with the latest master to avoid conflicts (via merge from master or rebase)

  • [x ] I have added the required tests to prove the fix/feature I am adding

  • [ x] I have updated the documentation (if necessary)

  • I have run the tests and they pass

  • I have run the lint and it passes (pod lib lint)

This merge request fixes / refers to the following issues: ...

Pull Request Description

This backwards-compatible change fixes SDWebImage so it will compile under Xcode 11.
...

@dreampiggy
Copy link
Contributor

I'm using Xcode 11-beta. This API is still available under iOS 13 SDK. Does this cause problem ?

image

@dreampiggy
Copy link
Contributor

dreampiggy commented Jun 5, 2019

This is not because of API changes. This is because the Default Xcode Warning Flags.

In Xcode 11, the default warning flags turn on the -Werror,-Wshorten-64-to-32. Which treat this implict convert as a Error but not a Warning.

However, in Xcode 10, this does not trigger as Error.

Though this fix is OK. I found it's a little strange, because SDWebImage always fix all the warnings from Xcode before releases. This warning should not exist at that time.

@kinarob What about turn SDWebImage warning flags as -Werror, -Weverything ? (Treat all Warnings as Errors)

@dreampiggy
Copy link
Contributor

dreampiggy commented Jun 5, 2019

I found the reason. Seems the clang compiler bug of warning flags before Xcode 11. It will not cause a warning when using the typedef NS_ENUM(NSInteger) enum, but only works for the NSInteger type.

See the test case:

Xcode 10

image

Xcode 11

image

@dreampiggy
Copy link
Contributor

I'll merge this now. And also with SDWebImage 4.x branch (have the same issue). And then release two patch version for 3.x version and 4.x version

@dreampiggy dreampiggy merged commit cc09c9f into SDWebImage:3.x Jun 5, 2019
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.

3 participants