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: uint64_t used to permit C.ulong, but no longer does #31093

ianlancetaylor opened this Issue Mar 27, 2019 · 0 comments


None yet
1 participant
Copy link

commented Mar 27, 2019

This program works fine with Go 1.12.

package main

// #include <stdint.h>
// static uint64_t foo(uint64_t v) { return v; }
import "C"

import "fmt"

func main() {
	i := 0
	j :=
	fmt.Printf("%T %d\n", j, j)

With current tip, it fails to build with

# command-line-arguments
foo.go:11:20: cannot use _Ctype_ulong(i) (type _Ctype_ulong) as type uint64 in argument to _Cfunc_foo

This is a consequence of the change for #29878. We need to address it one way or another.

CC @phst

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