Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/cgo: randomly produces spurious errors involving incompatible C types #8463
What does 'go version' print? go version go1.3 linux/amd64 What steps reproduce the problem? If possible, include a link to a program on play.golang.org. http://play.golang.org/p/gQM33-crSr Running go build will, about 15% of the time, produce a seemingly spurious error. What happened? ian@tau:~/devel/go/src/github.com/ianremmler/foobar% go build # github.com/ianremmler/foobar ./foobar.go:31: cannot use f (type *C.foo) as type *C.struct_foo in argument to toGo ./foobar.go:32: cannot use gf.toC() (type *C.struct_foo) as type *C.foo in argument to _Cfunc_foofunc What should have happened instead? No error. Please provide any additional information below. This is a pared down example based on a wrapper for the chipmunk physics library that I forked and have been (mildy) maintaining: https://github.com/ianremmler/chipmunk The error did not occur in earlier Go versions. The cyclically dependent C structs seem to be implicated as the error goes away if the bar pointer is removed from foo, or vice versa.