Closed
Description
Using an incomplete typedef seems to sometimes cause an "inconsistent definitions" error from cgo.
GOPATH/src/a/a.go:
package a
// typedef struct S ST;
// ST* M() {}
import "C"
func F1() {
C.M()
}
GOPATH/src/a/b.go:
package a
// typedef struct S ST;
// struct S { int f; };
import "C"
func F2(p *C.ST) {
p.f = 1
}
> go build a
# a
inconsistent definitions for C.ST
> ~/go1.10/bin/go build a
> # no error
Reverting https://golang.org/cl/123177 (b888a62) fixes cgo on tip. CC @randall77