mirror of
https://github.com/golang/go
synced 2024-11-24 12:30:14 -07:00
7904946eeb
In order to fix issue #9401 the compiler was changed to add a padding byte to any non-empty Go struct that ends in a zero-sized field. That causes the Go version of such a C struct to have a different size than the C struct, which can considerable confusion. Change cgo so that it discards any such zero-sized fields, so that the Go and C structs are the same size. This is a change from previous releases, in that it used to be possible to refer to a zero-sized trailing field (by taking its address), and with this change it no longer is. That is unfortunate, but something has to change. It seems better to visibly break programs that do this rather than to silently break programs that rely on the struct sizes being the same. Update #9401. Fixes #11925. Change-Id: I3fba3f02f11265b3c41d68616f79dedb05b81225 Reviewed-on: https://go-review.googlesource.com/12864 Reviewed-by: Russ Cox <rsc@golang.org> |
||
---|---|---|
.. | ||
issue8828 | ||
issue9026 | ||
issue9400 | ||
align.go | ||
api.go | ||
backdoor.go | ||
basic.go | ||
buildid_linux.go | ||
callback_c_gc.c | ||
callback_c_gccgo.c | ||
callback_c.c | ||
callback.go | ||
cflags.go | ||
cgo_linux_test.go | ||
cgo_test.go | ||
cthread_unix.c | ||
cthread_windows.c | ||
cthread.go | ||
duplicate_symbol.go | ||
env.go | ||
exports.go | ||
fpvar.go | ||
helpers.go | ||
issue1222.go | ||
issue1328.go | ||
issue1560.go | ||
issue1635.go | ||
issue2462.go | ||
issue3250.go | ||
issue3250w.go | ||
issue3261.go | ||
issue3729.go | ||
issue3729w.go | ||
issue3741.go | ||
issue3775.go | ||
issue3945.go | ||
issue4029.go | ||
issue4029w.go | ||
issue4054a.go | ||
issue4054b.go | ||
issue4273.c | ||
issue4273b.c | ||
issue4339.c | ||
issue4339.go | ||
issue4339.h | ||
issue4417.go | ||
issue4857.go | ||
issue5227.go | ||
issue5242.go | ||
issue5337.go | ||
issue5337w.go | ||
issue5548_c.c | ||
issue5548.go | ||
issue5603.go | ||
issue5740.go | ||
issue5740a.c | ||
issue5740b.c | ||
issue5986.go | ||
issue6128.go | ||
issue6390.go | ||
issue6472.go | ||
issue6506.go | ||
issue6612.go | ||
issue6833_c.c | ||
issue6833.go | ||
issue6997_linux.c | ||
issue6997_linux.go | ||
issue7234_test.go | ||
issue7560.go | ||
issue7665.go | ||
issue7786.go | ||
issue7978.go | ||
issue8092.go | ||
issue8148.go | ||
issue8331.h | ||
issue8331a.go | ||
issue8331b.go | ||
issue8428.go | ||
issue8441.go | ||
issue8517_windows.c | ||
issue8517_windows.go | ||
issue8517.go | ||
issue8694.go | ||
issue8811.c | ||
issue8811.go | ||
issue8828.go | ||
issue8945.go | ||
issue9026.go | ||
issue9400_linux.go | ||
issue9557.go | ||
issue10303.go | ||
issue11925.go | ||
setgid_linux.go | ||
sigprocmask_linux.c | ||
sigprocmask_linux.go | ||
sleep_windows_386.go |