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

ianlancetaylor opened this issue Dec 21, 2018 · 1 comment


Copy link

commented Dec 21, 2018

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

This comment has been minimized.

Copy link

commented Dec 21, 2018

Change mentions this issue: cmd/cgo: don't let inserted /*line*/ become a // comment

@gopherbot gopherbot closed this in 08477a3 Dec 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.