Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update to Xcode 6.3 breaks app - Google GTLTouchStaticLib "not equal to a null pointer is always true"

I use Google Drive SDK in my app.

It has worked perfectly since around June 2014.

Following update to Xcode 6.3, none of my targets build.

The implementation file GTMOAuth2ViewControllerTouch.m contains two blocks that the compiler complains about:

if (accessibility == NULL
    && &kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly != NULL) {
        accessibility = kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly;
}

specifically with the message: "Comparison of address of kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly not equal to a null pointer is always true".

AND

if (accessibility != NULL && &kSecAttrAccessible != NULL) {
    [keychainQuery setObject:(id)accessibility
                      forKey:(id)kSecAttrAccessible];
}

specifically with the message: "Comparison of address of kSecAttrAccessible not equal to a null pointer is always true".

The compiler is telling me that the two keys when compared to != NULL is always true.

I believe my lack of computer science training leaves me unable to understand the issue here - maybe that is just a bad perception?

I've had a look at this question but cannot understand the context in relation to my problem with Google Drive SDK implementation file GTMOAuth2ViewControllerTouch.m

I'd really like to understand the underlying issue.

Please help...

like image 298
andrewbuilder Avatar asked Mar 17 '23 11:03

andrewbuilder


1 Answers

Instead of those snippets, you can use: accessibility = kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly; and [keychainQuery setObject:(id)accessibility forKey:(id)kSecAttrAccessible];

This is because the constants will never have a NULL pointer, so there is no reason to do checking. I believe an update to the SDK is available to fix but you can do it manually.

like image 74
Schemetrical Avatar answered Apr 07 '23 02:04

Schemetrical