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: some type checks tightened since Go 1.12 #31601

Closed
eliasnaur opened this issue Apr 21, 2019 · 2 comments

Comments

@eliasnaur
Copy link
Contributor

commented Apr 21, 2019

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

$ go version
go version devel +dc193dee15 Fri Apr 19 19:47:53 2019 +0000 linux/amd64

Does this issue reproduce with the latest release?

Only with tip.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/elias/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/elias/go"
GOPROXY=""
GORACE=""
GOROOT="/home/elias/dev/go-tip"
GOTMPDIR=""
GOTOOLDIR="/home/elias/dev/go-tip/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build014756832=/tmp/go-build -gno-record-gcc-switches"

What did you do?

$ git clone https://git.sr.ht/~sircmpwn/go-libvterm
...
$ cd go-libvterm
$ git checkout 75984434 
...
$ go1.12.2 build
$ go build
# git.sr.ht/~sircmpwn/go-libvterm
./vterm.go:215:8: cannot use _Ctype_uchar(r) (type _Ctype_uchar) as type uint8 in assignment
./vterm.go:216:10: cannot use _Ctype_uchar(g) (type _Ctype_uchar) as type uint8 in assignment
./vterm.go:217:9: cannot use _Ctype_uchar(b) (type _Ctype_uchar) as type uint8 in assignment

What did you expect to see?

No errors from the go tip build.

What did you see instead?

An error caused by stricter C type checks.

Note that the cgo error is technically correct: the correct type of the VTermColor fields is indeed uint8_t, not uchar. I'm filing this to make sure the tighter checks are deliberate.

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Apr 22, 2019

Same as #31093?

@eliasnaur

This comment has been minimized.

Copy link
Contributor Author

commented Apr 22, 2019

Seems so.

@eliasnaur eliasnaur closed this Apr 22, 2019

ddevault added a commit to ddevault/go-libvterm that referenced this issue May 26, 2019
Fix build errors with go tip (1.13)
See also golang/go#31601.

Gofmt vterm.go while here.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.