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/cgo: mishandles type conversions in expression #29383

Closed
ianlancetaylor opened this issue Dec 21, 2018 · 1 comment
Closed

cmd/cgo: mishandles type conversions in expression #29383

ianlancetaylor opened this issue Dec 21, 2018 · 1 comment
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Milestone

Comments

@ianlancetaylor
Copy link
Contributor

This test case compiles with Go 1.11.

package p

// #include <stddef.h>
import "C"

func xcalloc(n, size uint) int {
	if 0/C.size_t(n) < C.size_t(size) {
		return 0
	}
	return 0
}

With tip I get

foo.go:8:3: syntax error: unexpected return, expecting expression
@ianlancetaylor ianlancetaylor added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker labels Dec 21, 2018
@ianlancetaylor ianlancetaylor added this to the Go1.12 milestone Dec 21, 2018
@gopherbot
Copy link

Change https://golang.org/cl/155638 mentions this issue: cmd/cgo: don't let inserted /*line*/ become a // comment

@golang golang locked and limited conversation to collaborators Dec 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Projects
None yet
Development

No branches or pull requests

2 participants