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: false positive about passing Go pointer to C #23670

Closed
ericlagergren opened this issue Feb 2, 2018 · 1 comment

Comments

Projects
None yet
4 participants
@ericlagergren
Copy link
Contributor

commented Feb 2, 2018

1.9.2, linux/amd64

package main

func main() {
	A := F{}
	C := F{}
	C.Copy(&A)
}

type F struct{ b map[int]int }

func (f *F) Copy(f2 *F) { f.b = f2.b }

go vet warns: foo.go:6: possibly passing Go type with embedded pointer to C. Additionally, it prints the message twice.

Renaming C to B gets rid of the false positive.

@ericlagergren ericlagergren changed the title cmt/vet: false positive about passing Go pointer to C cmd/vet: false positive about passing Go pointer to C Feb 2, 2018

@ianlancetaylor ianlancetaylor added this to the Go1.11 milestone Feb 2, 2018

@mvdan

This comment has been minimized.

Copy link
Member

commented Feb 3, 2018

Dup of #20655, and already fixed in 1.10.

@mvdan mvdan closed this Feb 3, 2018

@golang golang locked and limited conversation to collaborators Feb 3, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.