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
Closed

cmd/vet: false positive about passing Go pointer to C #23670

ericlagergren opened this issue Feb 2, 2018 · 1 comment
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@ericlagergren
Copy link
Contributor

ericlagergren 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
@ianlancetaylor ianlancetaylor added the NeedsFix The path to resolution is known, but the work has not been done. label Feb 2, 2018
@mvdan
Copy link
Member

mvdan commented Feb 3, 2018

Dup of #20655, and already fixed in 1.10.

@mvdan mvdan closed this as completed 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.
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