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
The following code works under Go 1.2 but fails to compile with the most recent go tip
(4b3cdcb02f2d).
package cgotest
/*
#pragma pack(1)
struct foo {
char c;
int x;
};
*/
import "C"
import "unsafe"
func foo(f *C.struct_foo) int {
return int(f.x)
}
This is what the correspond _cgo_type.go looks like:
type _Ctype_char int8
type _Ctype_int int32
type _Ctype_struct_foo struct {
c _Ctype_char
_ [4]byte
}
In Go 1.2, the type definition used to have the x field instead of an underscore. This
looks like a regression to me.