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

Xcode 6.3 reports semantic issues #76

Open
NikolayEntin opened this issue Apr 9, 2015 · 1 comment
Open

Xcode 6.3 reports semantic issues #76

NikolayEntin opened this issue Apr 9, 2015 · 1 comment

Comments

@NikolayEntin
Copy link

/.../RHAddressBook/RHAddressBookSharedServices.m:122:13: Comparison of function 'ABAddressBookCreateWithOptions' not equal to a null pointer is always true

this comes from such blocks as:

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 60000
        if (ABAddressBookCreateWithOptions != NULL){
...
#endif

it offers Fix-It solution

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 60000
        if (&ABAddressBookCreateWithOptions != NULL){
...
#endif

I.e. to use reference to the method.

(and there are about 10-15 issues like that)

Actually I'm quite confused, I think XCode fix is not correct:
Thise comparisons are made to check availability of the functions, so it's correct that in target environment (iOS6+), this will be always true (methods presented). But it might be different on different environment (though still during compilation it will probably generate the same optimization - always false).
But I don't want to have open issues in my project, using of '&' in front of the method name still will work on iOS6+ - it refers to allocation of the method in method allocation table (or whatever) and it won't be NULL. But I have no idea if this will be issue (not for me) on iOS < 6.

Anyone advice?

@ogezue
Copy link

ogezue commented Apr 26, 2015

Why not dropping support for iOS<6? . IOS is not Android :)

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

No branches or pull requests

2 participants