Open willie opened 3 years ago
The problem here is
func HTTPGet(url *C.char, writeFunc C.writeFunc, writeFuncData unsafe.Pointer) (read int64) {
Note that writeFunc
is both the Go parameter name and the C type name. This leads to confusion in the generated C code.
YES! Changing the Go parameter name fixed the problem. Such a relief and an easy change. Thank you for the help @ianlancetaylor
@ianlancetaylor Ian, is there something to do here for Go 1.17, or is it appropriate to move it to Backlog until it becomes more clear what the timeline of a fix might be?
Moving to Backlog.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I build a Go c-archive static library to use in several C/C++ programs. Building c-archives with cgo broke in a way that I don't understand in Go 1.15 and later. Building with Go 1.14 works fine. I put together a simple example here: https://github.com/willie/cgotest
What did you expect to see?
I expected to be able to build a c-archive static library with no errors.
What did you see instead?