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
As of revision 0015a25415455c390ae135bef7de2d5e2b10ee88:
$ cat test.go
// +build ignore
package test
/*
typedef struct {
void *p;
void **q;
void ***r;
} s;
*/
import "C"
type S C.s
$ go tool cgo -cdefs test.go
// Created by cgo -cdefs - DO NOT EDIT
// cgo -cdefs test.go
typedef struct S S;
#pragma pack on
struct S {
byte *p;
byte **q;
void ***r;
};
#pragma pack off
$ go tool cgo -godefs test.go
// Created by cgo -godefs - DO NOT EDIT
// cgo -godefs test.go
package test
type S struct {
P *byte
Q **byte
R **unsafe.Pointer
}
At a minimum, this seems inconsistent to me, and we can simplify cmd/cgo somewhat
(namely eliminating typeConv.todoFlds) if we're okay with simply always mapping
"void *" to "*byte". I've looked over the uses of -cdefs and
-godefs in the runtime and syscall packages, and I don't see any types that should
change as a consequence of this.
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: