Commit 02327a72 authored by Russ Cox's avatar Russ Cox

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
parent c1fbe589
......@@ -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{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment