1
0
mirror of https://github.com/golang/go synced 2024-10-03 10:21:22 -06:00

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
This commit is contained in:
Russ Cox 2011-01-06 15:15:31 -05:00
parent c1fbe589a9
commit 02327a72d7

View File

@ -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{