cmd/cgo: cannot call functions with variable-argument lists. (original) (raw)

by akidan:

A package such as the following will not compile with cgo. (printf is a contrived example, but this would be useful for bridging objective c through id objc_msgSend(id self, SEL op, ...);)

--- (file foo.go) package foo

// #include <stdio.h> import "C"

func PrintStuff() { C.printf(C.CString("Hello")) }


$ cgo foo.go

What is the expected output? Program compiles and is able to call function with variable-argument list.

What do you see instead? unexpected type: ...

What is your GOOS?GOOS? GOOS?GOARCH? darwin amd64

Which revision are you using? (hg identify) 43fd9bb529f0+ tip