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: fails using pointers to C structs on exported functions #2612
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.
This issue was closed.