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

x/mobile: NSData* generated code compilation fails #27705

Closed
tadovas opened this issue Sep 17, 2018 · 2 comments
Closed

x/mobile: NSData* generated code compilation fails #27705

tadovas opened this issue Sep 17, 2018 · 2 comments

Comments

@tadovas
Copy link

@tadovas tadovas commented Sep 17, 2018

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.9.2 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/tadovas/work/go/openvpnv3-go-bindings"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.9.2/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.9.2/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/_j/73ymsvw56v989xyfwn6q18_m0000gn/T/go-build788123186=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

What did you do?

Binding call to any iOS function which accepts NSData* as parameter

What did you expect to see?

Successfully binding and build.

What did you see instead?

gobind
/var/folders/_j/73ymsvw56v989xyfwn6q18_m0000gn/T/gomobile-work-516612884/src/gobind/interfaces_darwin.go:51: cannot use 0 (type int) as type bool in argument to fromSlice

It seems that https://github.com/golang/mobile/blob/master/bind/objc/seq_darwin.go.support#L60 function fromSlice expects second parameter as boolean, but https://github.com/golang/mobile/blob/master/bind/genobjcw.go#L476 generates fromSlice call and passes 0 as second argument instead.
The same is with toSlice function and code generation.

Am I missing something here?

@tadovas

This comment has been minimized.

Copy link
Author

@tadovas tadovas commented Sep 17, 2018

Created a PR anyway.

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Sep 17, 2018

Change https://golang.org/cl/135423 mentions this issue: bind: pass correct arguments to fromSlice and toSlice

@golang golang locked and limited conversation to collaborators Sep 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.