From: Russ Cox Date: Thu, 6 Jan 2011 20:15:31 +0000 (-0500) Subject: cgo: disallow use of C.errno X-Git-Tag: weekly.2011-01-06~3 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=02327a72d7ae27c16ab4ed702138ca6a818e6123;p=gostls13.git cgo: disallow use of C.errno It's incorrect, and it causes cryptic linker errors. Fixes #1360. R=r, r2 CC=golang-dev https://golang.org/cl/3880041 --- diff --git a/src/cmd/cgo/ast.go b/src/cmd/cgo/ast.go index 7c64a5d246..8689ac3dac 100644 --- a/src/cmd/cgo/ast.go +++ b/src/cmd/cgo/ast.go @@ -141,6 +141,10 @@ func (f *File) saveRef(x interface{}, context string) { context = "expr" } goname := sel.Sel.Name + if goname == "errno" { + error(sel.Pos(), "cannot refer to errno directly; see documentation") + return + } name := f.Name[goname] if name == nil { name = &Name{