Commit 2eb00d57 authored by Russ Cox's avatar Russ Cox

cgo: silence warning for C call returning const pointer

Fix suggested by Albert Strasheim.

R=adg
CC=golang-dev
https://golang.org/cl/2154041
parent fa92b113
......@@ -107,7 +107,11 @@ func (p *Package) structType(n *Name) (string, int64) {
fmt.Fprintf(&buf, "\t\tchar __pad%d[%d];\n", off, pad)
off += pad
}
fmt.Fprintf(&buf, "\t\t%s r;\n", t.C)
qual := ""
if t.C[len(t.C)-1] == '*' {
qual = "const "
}
fmt.Fprintf(&buf, "\t\t%s%s r;\n", qual, t.C)
off += t.Size
}
if off%p.PtrSize != 0 {
......
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