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/vet, cgo: spurious report on C.CBytes call #17563

Closed
alandonovan opened this issue Oct 24, 2016 · 1 comment
Closed

cmd/vet, cgo: spurious report on C.CBytes call #17563

alandonovan opened this issue Oct 24, 2016 · 1 comment
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@alandonovan
Copy link
Contributor

$ nl -ba a.go
     1  package main
     2
     3  import "C"
     4
     5  func _(b []byte) {
     6          _ = C.CBytes(b)
     7  }
$ vet a.go
a.go:6: possibly passing Go type with embedded pointer to C

Vet reports an error each time the C.CBytes function is called, because its argument is a byte slice, which contains a pointer. However, this function is being used exactly as intended and Vet should make an special exception for it.

@gopherbot
Copy link

CL https://golang.org/cl/31810 mentions this issue.

@quentinmit quentinmit added the NeedsFix The path to resolution is known, but the work has not been done. label Oct 24, 2016
@quentinmit quentinmit added this to the Go1.8 milestone Oct 24, 2016
@quentinmit quentinmit changed the title vet: cgo: spurious report on C.CBytes call cmd/vet, cgo: spurious report on C.CBytes call Oct 24, 2016
gopherbot pushed a commit that referenced this issue Oct 24, 2016
Fixes issue #17563

Change-Id: Ibb41ea9419907193526cc601f6afd07d8689b1fe
Reviewed-on: https://go-review.googlesource.com/31810
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
@rsc rsc closed this as completed Oct 25, 2016
@golang golang locked and limited conversation to collaborators Oct 25, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants