PerfectlySoft / Perfect-MariaDB

A stand-alone Swift wrapper around the MariaDB client library, enabling access to MariaDB servers. http://www.perfect.org
https://www.perfect.org
Apache License 2.0
9 stars 8 forks source link

Swift Compiler Warning #6

Closed jiunnc closed 4 years ago

jiunnc commented 4 years ago

I got a Swift Compiler Warning: Perfect-MariaDB-master/Sources/MariaDB/MySQLStmt.swift:288:17: Initialization of 'UnsafeRawPointer' results in a dangling pointer

The code is as below.

private func allocated(_ a: [Int8]) -> UnsafeMutableRawBufferPointer? {
    let buffer = UnsafeMutableRawBufferPointer.allocate(byteCount: a.count, alignment: 0)
    let u = UnsafeRawPointer(a)
    if let p = buffer.baseAddress {
        memcpy(p, u, a.count)
    }
    return buffer
}

My OS X is 10.15.5 and Xcode version is 11.5.

Please help. Thanks

RockfordWei commented 4 years ago

fixed on tag 3.0.4. Thank you.

jiunnc commented 4 years ago

Thanks a lot.

Rockford Wei notifications@github.com 於 2020年7月3日 下午9:30 寫道:

Closed #6 https://github.com/PerfectlySoft/Perfect-MariaDB/issues/6.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PerfectlySoft/Perfect-MariaDB/issues/6#event-3511068325, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQBFIPKGSW25QEACHB72RD3RZXMRBANCNFSM4OI45Z2A.