]> Cypherpunks repositories - gostls13.git/commit
cmd/cgo: given typedef struct S T, make C.T and C.struct_S interchangeable
authorRuss Cox <rsc@golang.org>
Wed, 28 May 2014 18:04:31 +0000 (14:04 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 28 May 2014 18:04:31 +0000 (14:04 -0400)
commit0782ee3ad57a21bd3566f20e76e4e453613e7a23
tree5a56c49c546ad8dfa895c91ef2ce5cb5cf8f006a
parent94849d5a78009dcaafbde2847cc0a27f53aa3723
cmd/cgo: given typedef struct S T, make C.T and C.struct_S interchangeable

For incomplete struct S, C.T and C.struct_S were interchangeable in Go 1.2
and earlier, because all incomplete types were interchangeable
(even C.struct_S1 and C.struct_S2).

CL 76450043, which fixed issue 7409, made different incomplete types
different from Go's point of view, so that they were no longer completely
interchangeable.

However, imprecision about C.T and C.struct_S - really the same
underlying C type - is the one behavior enabled by the bug that
is most likely to be depended on by existing cgo code.
Explicitly allow it, to keep that code working.

Fixes #7786.

LGTM=iant, r
R=golang-codereviews, iant, r
CC=golang-codereviews
https://golang.org/cl/98580046
doc/go1.3.html
misc/cgo/test/issue7786.go [new file with mode: 0644]
src/cmd/cgo/gcc.go