mirror of
https://github.com/golang/go
synced 2024-11-20 07:04:40 -07: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:
parent
c1fbe589a9
commit
02327a72d7
@ -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{
|
||||
|
Loading…
Reference in New Issue
Block a user