Re: [go-nuts] cgo and varargs

278 views
Skip to first unread message

minux

unread,
Apr 24, 2013, 3:40:51 PM4/24/13
to gwenn...@gmail.com, golan...@googlegroups.com

On Thu, Apr 25, 2013 at 2:22 AM, <gwenn...@gmail.com> wrote:
It seems that issue 2425 has been closed but it should still be opened.
It has been made a duplicate of issue 1800 that is related to error reporting and missing line number.
Go doesn't have support for C style variable argument function so you really
can't call or use vararg C functions in Go program (otherwise what types
should we give them? You could try to give a Go type to C printf function
as an exercise)

cgo program is still a Go program with a magic C import, and as in other
Go programs, every value in it must have valid Go type, so C's varags and
bitfields are not usable (can't even reference them or use a struct that uses
the latter).
Reply all
Reply to author
Forward
0 new messages