sqlite3-sys icon indicating copy to clipboard operation
sqlite3-sys copied to clipboard

API doesn't permit specifying transient destructors without potentially unsound coercions

Open udoprog opened this issue 1 year ago • 1 comments

See for example: sqlite3_result_blob.

In sqlite3 these support special sentinel values which marks the value as transient, see: https://sqlite.org/c3ref/c_static.html.

This can only be done by coercing the sentinel value -1 into the Option<T> directly, which to my knowledge is not guaranteed to be correct.

udoprog avatar Jun 14 '24 12:06 udoprog

Thank you for the note. I guess one has to look into how to customize bindgen to accommodate this.

IvanUkhov avatar Jun 17 '24 13:06 IvanUkhov