After upgrading to Xcode 11.4 and Swift 5.2, the following warnings now happen:
XTRepository+Staging.swift:129:19: warning: initialization of 'UnsafeMutablePointer<UnsafeMutablePointer<Int8>?>' results in a dangling pointer
let array = UnsafeMutablePointer<
^~~~~~~~~~~~~~~~~~~~~
XTRepository+Staging.swift:130:62: note: implicit argument conversion from '[UnsafeMutablePointer<CChar>?]' (aka 'Array<Optional<UnsafeMutablePointer<Int8>>>') to 'UnsafePointer<UnsafeMutablePointer<Int8>?>' produces a pointer valid only for the duration of the call to 'init(mutating:)'
UnsafeMutablePointer<Int8>?>(mutating: paths)
^~~~~
XTRepository+Staging.swift:130:62: note: use the 'withUnsafeBufferPointer' method on Array in order to explicitly convert argument to buffer pointer valid for a defined scope
UnsafeMutablePointer<Int8>?>(mutating: paths)
^
GitExtensions.swift:177:28: warning: initialization of 'UnsafeMutableRawPointer' results in a dangling pointer
gitCallbacks.payload = UnsafeMutableRawPointer(&mutableCallbacks)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GitExtensions.swift:177:52: note: implicit argument conversion from 'RemoteCallbacks' to 'UnsafeMutableRawPointer' produces a pointer valid only for the duration of the call to 'init(_:)'
gitCallbacks.payload = UnsafeMutableRawPointer(&mutableCallbacks)
^~~~~~~~~~~~~~~~~
GitExtensions.swift:177:52: note: use 'withUnsafeMutableBytes' in order to explicitly convert argument to buffer pointer valid for a defined scope
gitCallbacks.payload = UnsafeMutableRawPointer(&mutableCallbacks)
^
After upgrading to Xcode 11.4 and Swift 5.2, the following warnings now happen: