https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67976
--- Comment #1 from Dominik Vogt <vogt at linux dot vnet.ibm.com> --- When cgo encounters the "C.foo_cgo", it determines that it must be a variable, but finds no C definition, so it generates "extern char foo_cgo[]" (out.go) as the type. This conflicts with the declaration in the comment at the beginning of the file. Replacing /* int foo_cgo(unsigned); */ with /* extern char foo_cgo[]; */ Makes this code compile for me. Is this kind of declaration supported by the cgo version from the golang repository? (If not, what would the symbol C.foo_cgo be good for).