• Russ Cox's avatar
    cmd/cgo: given typedef struct S T, make C.T and C.struct_S interchangeable · 0782ee3a
    Russ Cox authored
    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
    0782ee3a
gcc.go 45.4 KB