You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cmd/cgo: Consider the code below. It will print 72057628379708111 instead of the
expected 0. Uncomment the last line and everything works as expected.
I observed the bug only with enum values of 0. As soon as another constant with a
non-zero value out of the same enum is used, all is good. Using multiple constants with
a value of 0 of the same enum does not fix the problem. In this case, different values
may be printed in each case.
package main
/*
enum Const { ZERO, ONE, };
*/
import "C"
import "fmt"
func main() {
fmt.Println(int64(C.ZERO))
// fmt.Println(int64(C.ONE))
}
Which compiler are you using (5g, 6g, 8g, gccgo)?
6g
Which operating system are you using?
Mac OS X Lion 10.7.4
Which version are you using? (run 'go version')
go version weekly.2012-03-27 +2874979af37a
Please provide any additional information below.