-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[6.0] Android: add better nullability checks for nullability annotations added in NDK 26 #5010
Conversation
We mentioned this in #4850 - but we will be merging that work here, so we'll only need one patch for this in the end. |
if let pwd = getpwuid(s.st_uid), let pwd_name = pwd.pointee.pw_name { | ||
let name = String(cString: pwd_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if let pwd = getpwuid(s.st_uid), let pwd_name = pwd.pointee.pw_name { | |
let name = String(cString: pwd_name) | |
if let pwd = getpwuid(s.st_uid), let pw_name = pwd.pointee.pw_name { | |
let name = String(cString: pw_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change is fine by me, but as mentioned in #4889, I will get this working with the swift-foundation
re-core by next week and re-submit for trunk then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#5011 is the PR to track merging main to release/6.0.
if let grd = getgrgid(s.st_gid), let grd_name = grd.pointee.gr_name { | ||
let name = String(cString: grd_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if let grd = getgrgid(s.st_gid), let grd_name = grd.pointee.gr_name { | |
let name = String(cString: grd_name) | |
if let grd = getgrgid(s.st_gid), let gr_name = grd.pointee.gr_name { | |
let name = String(cString: gr_name) |
@swift-ci please test |
Explanation: This is needed because Bionic recently added a bunch of these annotations.
Scope: Additional nullability checks and force unwraps only
Issue: None
Original PR: This is a cut-down #4850, which will have to be reworked for the
swift-foundation
merge.Risk: Low
Testing: I made sure this pull doesn't break anything by testing it with the previous NDK 25c also. I used this patch with others to build the Swift toolchain for my Android CI, finagolfin/swift-android-sdk#122, and the Termux app for Android, which now uses NDK 26b.
Reviewer: @compnerd