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

replacing deprecated methods per analyzer warning notes #38

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions BugshotKit/BugshotKit.m
Original file line number Diff line number Diff line change
Expand Up @@ -520,8 +520,15 @@ - (BOOL)updateFromASL
q = asl_new(ASL_TYPE_QUERY);
aslresponse r = asl_search(NULL, q);
BOOL foundNewEntries = NO;


#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
// The deprecation attribute incorrectly states that the replacement method, asl_next()
// is available in __IPHONE_7_0; asl_next() first appears in __IPHONE_8_0.
// This would require both a compile and runtime check to properly implement the new method
// while the minimum deployment target for this project remains iOS 7.0.
while ( (m = aslresponse_next(r)) ) {
#pragma clang diagnostic pop
if (myPID != atol(asl_get(m, ASL_KEY_PID))) continue;

// dupe checking
Expand All @@ -536,8 +543,15 @@ - (BOOL)updateFromASL
if (msg == NULL) { continue; }
[self addLogMessage:[NSString stringWithUTF8String:msg] timestamp:msgTime];
}


#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
// The deprecation attribute incorrectly states that the replacement method, asl_release()
// is available in __IPHONE_7_0; asl_release() first appears in __IPHONE_8_0.
// This would require both a compile and runtime check to properly implement the new method
// while the minimum deployment target for this project remains iOS 7.0.
aslresponse_free(r);
#pragma clang diagnostic pop
asl_free(q);

return foundNewEntries;
Expand Down