-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/cgo: inconsistent definitions for C.sfColor #8133
Labels
Milestone
Comments
Just noticed a minor copy-paste typo. "p1" should be "p2" in the following paragraph: The following files are present in the p1 repo: * "ab.go": http://play.golang.org/p/_nlL3rP6JB * "Color.h": http://play.golang.org/p/fBghn23MNw |
I believe the problem here is specifically with a C .h file that does a typedef of an untagged struct. If the Go package has more than one file that import "C" and #include that .h file, then we get this error from cgo. In cgo terms, the problem is that the typedef has been given the Go name of the struct. Since the structs are untagged, they get Go names like _Ctype_struct___INDEX, where INDEX differs. So we appears to have the same typedef referring to two different structs. |
Owner changed to @ianlancetaylor. Status changed to Started. |
CL https://golang.org/cl/102080043 mentions this issue. |
This issue was closed by revision 4e65f18. Status changed to Fixed. |
dsymonds
added a commit
that referenced
this issue
May 11, 2015
…mous struct ««« CL 102080043 / 256d975c53cb cmd/cgo: use same Go type for typedef to anonymous struct If we see a typedef to an anonymous struct more than once, presumably in two different Go files that import "C", use the same Go type name. Fixes #8133. LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/102080043 »»» TBR=adg CC=golang-codereviews https://golang.org/cl/102100043
wheatman
pushed a commit
to wheatman/go-akaros
that referenced
this issue
Jun 25, 2018
If we see a typedef to an anonymous struct more than once, presumably in two different Go files that import "C", use the same Go type name. Fixes golang#8133. LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/102080043
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: