go/types: support cgo semantics #23090
Labels
FeatureRequest
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
I was thinking about #975.
My idea is guessing argument types and making specialized wrappers.
For example,
We can convert following code
into
I'd like to leave these translations to cgo.
To promote this idea, we have to make
go/types
understand some special cgo semantics.C.char
,C.int
, ...)unsafe.Pointer
in the expression context (e.g.var xxx unsafe.Pointer = C.puts
)error
argument in the assignment context (e.g_, err := C.puts(C.CString("x"))
Is this acceptable?
FWIW, https://go-review.googlesource.com/c/go/+/83215 is the attempt.
The text was updated successfully, but these errors were encountered: