Skip to content
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: fails using pointers to C structs on exported functions #2612

Closed
gopherbot opened this issue Dec 23, 2011 · 3 comments
Closed

cmd/cgo: fails using pointers to C structs on exported functions #2612

gopherbot opened this issue Dec 23, 2011 · 3 comments
Milestone

Comments

@gopherbot
Copy link

by alexander.surma:

I build a small testcase for this particular problem:
https://gist.github.com/1514784

If you compile as is, the following error occurs:
unrecognized Go type *ast.StructType
unrecognized Go type *ast.StructType

If you comment out the current `Callback` implementation, and uncomment the other one
(as well as the import of the unsafe package). It will compile (and work as expected).

The problem does NOT occur, when:
* the function is not exported
* the parameter is not a struct (e.g. *C.int as a parameter type works just fine)

The problem does ALSO occur:
* when the using a pointer to a C struct as a return type
* when the parameter is just a C struct (i.e. NOT a pointer)

I'm on Mac OS 10.7.2, using weekly-2011-12-22 darwin/amd64. Same error on tip.
@adg
Copy link
Contributor

adg commented Jan 4, 2012

Comment 1:

Labels changed: added priority-go1, cgo, removed priority-triage.

Status changed to Accepted.

@robpike
Copy link
Contributor

robpike commented Jan 13, 2012

Comment 2:

Owner changed to builder@golang.org.

@rsc
Copy link
Contributor

rsc commented Feb 19, 2012

Comment 4:

This issue was closed by revision 1a0c8fe.

Status changed to Fixed.

@rsc rsc added this to the Go1 milestone Apr 10, 2015
@rsc rsc removed the priority-go1 label Apr 10, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants