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: unexpected semicolon, expecting expression error (part III) #31017

Closed
gooid opened this issue Mar 24, 2019 · 2 comments
Closed

cmd/cgo: unexpected semicolon, expecting expression error (part III) #31017

gooid opened this issue Mar 24, 2019 · 2 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@gooid
Copy link

gooid commented Mar 24, 2019

What version of Go are you using (go version)?

$ go version
go version go1.12 windows/amd64

main.go

package main

import (
	"unsafe"
)

/*
void cgofoo(void* a, int b) {}
*/
import "C"

func foo() {
	var p unsafe.Pointer

	C.cgofoo(nil, (C.int)(
		0))

	C.cgofoo(p, (C.int)(0))

	// syntax error: unexpected semicolon, expecting expression
	C.cgofoo(p, (C.int)(
		0))
}

func main() {}

What did you expect to see?

build success,
but go 1.11.4 is ok.

What did you see instead?

main.go:21:27: syntax error: unexpected semicolon, expecting expression

@ALTree
Copy link
Member

ALTree commented Mar 24, 2019

Thanks for reporting this.

This is related to #29748 and #29781. I've verified that tip still fails, so it's probably another variation the previous fixes don't cover.

cc @ianlancetaylor

@ALTree ALTree added this to the Go1.13 milestone Mar 24, 2019
@ALTree ALTree added the NeedsFix The path to resolution is known, but the work has not been done. label Mar 24, 2019
@ALTree ALTree changed the title cmd/go: build not compatibility cmd/cgo: unexpected semicolon, expecting expression error (part III) Mar 24, 2019
@gopherbot
Copy link

Change https://golang.org/cl/174524 mentions this issue: cmd/cgo: fix unexpected semicolon in rewritten line

@golang golang locked and limited conversation to collaborators May 6, 2020
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

3 participants