On Thu, Mar 23, 2017 at 8:54 AM, Peter Kleiweg <pklei...@xs4all.nl> wrote:
> Some code that includes C code compiles fine on Linux, but gives strange
> errors on Darwin.
>
>
> In one source file, that doesn't include C, I have this:
>
>     type reactor_socket struct {
>             e State
>             f func(State) error
>     }
>
> and...
>
>     reactor_socket{e: events, f: handler}
>
>
>
> In another file that does include C, I have this:
>
>     type State int
>
>
>
> Compiling of the first source file gives these errors on the line creating
> the reactor_socket:
>
>     workspace/go/src/github.com/pebbe/zmq4/reactor.go:57: cannot use events
> (type State) as type int in field value
>     workspace/go/src/github.com/pebbe/zmq4/reactor.go:57: cannot use handler
> (type func(State) error) as type func(int) error in field value
>
> It looks like in one source file, the type State is preserved, while in the
> other it is replaced by an int.
>
>
> Is this a compiler bug? What else could it be?
>
> Please see details at https://github.com/pebbe/zmq4/issues/97

I suppose it could be a cgo bug.  I can't recreate it, but I'm using
GNU/Linux.  I tried both GCC and clang.

Try running `go build -work` to preserve the temporary directory and
look at the generated .go files.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to