Skip to content

cmd/cgo: cannot call functions with variable-argument lists. #975

Open
@gopherbot

Description

@gopherbot

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?  $GOARCH?
darwin amd64

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions