Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation failure at GO GET time. #1

Open
stephan57160 opened this issue Jul 26, 2018 · 0 comments
Open

Compilation failure at GO GET time. #1

stephan57160 opened this issue Jul 26, 2018 · 0 comments

Comments

@stephan57160
Copy link

stephan57160 commented Jul 26, 2018

Example:

[devel@prod-70676b ~]$ go get github.com/misakwa/gozyre
# github.com/misakwa/gozyre
go/src/github.com/misakwa/gozyre/util.go:61: cannot use unsafe.Pointer(zmsg) (type unsafe.Pointer) as type **C.struct__zmsg_t in argument to func literal
[devel@prod-70676b ~]$ 
[devel@prod-70676b ~]$ go version
go version go1.9.3 linux/arm
[devel@prod-70676b ~]$ 

Patch proposal:

diff --git a/util.go b/util.go                                                                                                         
index 87ee4e8..085dd02 100644                                                                                                          
--- a/util.go                                                                                                                          
+++ b/util.go                                                                                                                          
@@ -58,7 +58,7 @@ func bytesToZmsg(ch <-chan []byte) (*C.struct__zmsg_t, error) {
                // gc collects it too early                                                                                            
                ret := C.zmsg_addmem(zmsg, unsafe.Pointer(&frame[0]), C.size_t(len(frame)))                                            
                if ret != 0 {                                                                                                          
-                       C.zmsg_destroy(unsafe.Pointer(zmsg))                                                                           
+                       C.zmsg_destroy(&zmsg)                                                                                          
                        err = ErrAddingFrame                                                                                           
                        break                                                                                                          
                }                                                                                                                      

The patch proposal follows other xxx_destroy() calls, found a bit above, in the same file:

                defer C.zlist_destroy(&zlist)
                ...
                defer C.zhash_destroy(&zhash)
                ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant