1
0
mirror of https://github.com/golang/go synced 2024-10-03 17:21:21 -06:00
go/misc/cgo
Ian Lance Taylor 689947d565 cmd/cgo: only record typedef name for pointer to struct
In a function argument, we handle a typedef for a pointer specially,
using the pointer type rather than the typedef, to permit the Go calls
to match the laxer type conversions permitted in C. We record the
typedef so that we use that type in the C code, in case it has a special
attribute. However, using the typedef is wrong when using a pointer to a
basic type, because the C code may sometimes use the typedef and
sometimes not, and using the typedef in all cases will cause incorrect
type errors on the Go side. Fortunately we only really need to use the
typedef when pointing to a struct/union/class, and in such a case
confusion is unlikely.

Fixes #17723.

Change-Id: Id2eaeb156faeaf2e8eb9cf0b8f95b44caf8cfbd2
Reviewed-on: https://go-review.googlesource.com/32536
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-11-01 23:06:24 +00:00
..
errors misc/cgo/errors: fix malloc test for dragonfly 2016-10-25 20:11:50 +00:00
fortran misc/cgo/fortran: fix gfortran compile test 2016-05-04 15:08:16 +00:00
gmp all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
life all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
nocgo cmd/ld: really import runtime/cgo for external link 2014-05-20 21:36:50 -07:00
stdio all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
test cmd/cgo: only record typedef name for pointer to struct 2016-11-01 23:06:24 +00:00
testasan runtime: more flexible heap memory mapping on 64-bits 2013-06-12 18:47:16 +04:00
testcarchive runtime: align stack pointer in sigfwd 2016-11-01 17:37:43 +00:00
testcshared all: fix spelling mistakes 2016-04-03 17:03:15 +00:00
testgodefs cmd/cgo: add -srcdir option 2016-10-30 19:14:08 +00:00
testplugin cmd/link: support plugins with no exported symbols 2016-11-01 20:56:30 +00:00
testsanitizers runtime/cgo: add tsan acquire/release around setenv/unsetenv 2016-08-23 14:07:58 +00:00
testshared cmd/compile, runtime: make the go.itab.* symbols module-local 2016-10-27 19:13:35 +00:00
testsigfwd misc/cgo/testsigfwd: add missing return statement 2016-08-30 21:44:14 +00:00
testso cmd/dist: convert testso test into Go 2015-06-12 04:33:50 +00:00
testsovar misc/cgo/testsovar: needs the extern keyword to export variables on non-windows platforms 2015-07-21 18:10:57 +00:00
testtls all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00