Skip to content

Instantly share code, notes, and snippets.

@james4k
Created October 14, 2013 07:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save james4k/6971932 to your computer and use it in GitHub Desktop.
Save james4k/6971932 to your computer and use it in GitHub Desktop.
diff -r a10c7a350ab5 src/cmd/cgo/gcc.go
--- a/src/cmd/cgo/gcc.go Sat Oct 12 18:40:41 2013 -0400
+++ b/src/cmd/cgo/gcc.go Mon Oct 14 02:12:48 2013 -0500
@@ -306,7 +306,7 @@
b.WriteString("void __cgo__f__(void) {\n")
b.WriteString("#line 1 \"cgo-test\"\n")
for i, n := range toSniff {
- fmt.Fprintf(&b, "%s; /* #%d */\nenum { _cgo_enum_%d = %s }; /* #%d */\n", n.C, i, i, n.C, i)
+ fmt.Fprintf(&b, "(%s); /* #%d */\nenum { _cgo_enum_%d = %s }; /* #%d */\n", n.C, i, i, n.C, i)
}
b.WriteString("}\n")
stderr := p.gccErrors(b.Bytes())
@@ -343,7 +343,8 @@
continue
case strings.Contains(line, ": useless type name in empty declaration"),
strings.Contains(line, ": declaration does not declare anything"),
- strings.Contains(line, ": unexpected type name"):
+ strings.Contains(line, ": unexpected type name"),
+ strings.Contains(line, ": expected expression"):
what = "type"
isConst[i] = false
case strings.Contains(line, ": statement with no effect"),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment