+build !cgocheck

192 views
Skip to first unread message

mattn

unread,
Nov 26, 2015, 5:27:20 AM11/26/15
to golang-nuts
go1.6 doesn't allow passing Go's pointer into C. And it seems to be possible to disable pragma +build !cgocheck.
I try to add this into go-gtk. But the error always displayed.

> panic: runtime error: cgo argument has Go pointer to Go pointer

Enyone know who to disable this feature? I can disable this with set $GODEBUG=cgocheck=0.

- mattn

Ian Lance Taylor

unread,
Nov 29, 2015, 12:01:07 PM11/29/15
to mattn, golang-nuts
On Thu, Nov 26, 2015 at 2:27 AM, mattn <matt...@gmail.com> wrote:
> go1.6 doesn't allow passing Go's pointer into C. And it seems to be possible
> to disable pragma +build !cgocheck.

No, using a cgocheck build tag was an idea I tried out but it was
never committed to the tree.


> I try to add this into go-gtk. But the error always displayed.
>
>> panic: runtime error: cgo argument has Go pointer to Go pointer
>
> Enyone know who to disable this feature? I can disable this with set
> $GODEBUG=cgocheck=0.

That is what you have to do to disable the check.

Of course, the code should eventually be changed.

Ian

mattn

unread,
Nov 29, 2015, 8:21:53 PM11/29/15
to golang-nuts, matt...@gmail.com
Yes, I understand. But probably, I might not be possible to fix all about this until release of go1.6 .
Reply all
Reply to author
Forward
0 new messages