Git Product home page Git Product logo

Comments (3)

AdamSLevy avatar AdamSLevy commented on June 3, 2024 1

It appears this warning may be safely ignored, but I would still like to better understand its root cause.

from sqlite.

josharian avatar josharian commented on June 3, 2024

This is also discussed here: golang/go#32411

I suspect that it comes from this line:

C.sqlite3_result_text(ctx.ptr, cv, C.int(len(v)), (*[0]byte)(C.free))

in

func (ctx Context) ResultText(v string) {
	var cv *C.char
	if len(v) != 0 {
		cv = C.CString(v)
	}
	C.sqlite3_result_text(ctx.ptr, cv, C.int(len(v)), (*[0]byte)(C.free))
}

and this line:

free = (*[0]byte)(C.free)

in

func (stmt *Stmt) BindText(param int, value string) {
	var v *C.char
	var free *[0]byte
	if len(value) == 0 {
		v = emptyCstr
	} else {
		v = C.CString(value)
		free = (*[0]byte)(C.free)
	}
	res := C.sqlite3_bind_text(stmt.stmt, C.int(param), v, C.int(len(value)), free)
	stmt.handleBindErr("BindText", res)
}

It is harmless, but it is also annoying. I'd also like to see it go away.

from sqlite.

josharian avatar josharian commented on June 3, 2024

One possible workaround is to define a C function that calls free, and then pass that C function instead of free to the sqlite calls as needed.

from sqlite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.