Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.

cwrappers.go uses *C.void instead of unsafe.Pointer #20

Open
bcmills opened this issue Sep 15, 2017 · 1 comment
Open

cwrappers.go uses *C.void instead of unsafe.Pointer #20

bcmills opened this issue Sep 15, 2017 · 1 comment

Comments

@bcmills
Copy link

bcmills commented Sep 15, 2017

The Go equivalent to C's void* type is unsafe.Pointer, and the cgo tool automatically wraps functions that accept or return void* to accept or return unsafe.Pointer instead.

cwrappers.go currently includes some functions that accept *C.void arguments, but none of them are actually called. If they were, you would likely find that the call sites require two conversions (to unsafe.Pointer and then to *C.void) where they should need only one (to unsafe.Pointer).

@bcmills
Copy link
Author

bcmills commented Sep 15, 2017

(See golang/go#21878.)

@bcmills bcmills changed the title cwrappers.go erroneously uses *C.void instead of unsafe.Pointer cwrappers.go uses *C.void instead of unsafe.Pointer Sep 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant