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 40 bit bitfield #22958

Closed
ianlancetaylor opened this issue Dec 1, 2017 · 2 comments
Closed

cmd/cgo: mishandles 40 bit bitfield #22958

ianlancetaylor opened this issue Dec 1, 2017 · 2 comments

Comments

@ianlancetaylor
Copy link
Contributor

Building this test case with go build foo.go

package p

/*
typedef struct {
	unsigned long x : 40;
} s;
*/
import "C"

var v C.s

produces

# command-line-arguments
/tmp/go-build300185653/b001/_cgo_gotypes.go:23:4: undefined: uint40

Oddly, something seems to be special about the number 40.

@ianlancetaylor ianlancetaylor added this to the Go1.11 milestone Dec 1, 2017
@ianlancetaylor
Copy link
Contributor Author

Ah, it fails when the bit size is a multiple of 8 other than 8, 16, 32, 64.

@gopherbot
Copy link

Change https://golang.org/cl/81435 mentions this issue: cmd/cgo: for C bitfields use only valid Go integer types

@golang golang locked and limited conversation to collaborators Dec 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants