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

cmd/cgo: access errno from void C function #3729

Closed
rsc opened this issue Jun 12, 2012 · 6 comments

Comments

@rsc
Copy link
Contributor

commented Jun 12, 2012

If a C function returns void then you cannot do

x, errno := C.f()

because there is no x.
Reported by dan.kortschak
@rsc

This comment has been minimized.

Copy link
Contributor Author

commented Sep 12, 2012

Comment 1:

Labels changed: added go1.1.

@rsc

This comment has been minimized.

Copy link
Contributor Author

commented Dec 10, 2012

Comment 2:

Labels changed: added size-m.

@rsc

This comment has been minimized.

Copy link
Contributor Author

commented Dec 10, 2012

Comment 3:

Labels changed: added suggested.

@rsc

This comment has been minimized.

Copy link
Contributor Author

commented Dec 10, 2012

Comment 4:

I think we can make C void functions return struct{} instead of returning nothing.
Then _, errno := C.f() works.
@minux

This comment has been minimized.

Copy link
Member

commented Dec 13, 2012

Comment 5:

https://golang.org/cl/6938052

Owner changed to @minux.

Status changed to Started.

@minux

This comment has been minimized.

Copy link
Member

commented Dec 17, 2012

Comment 6:

This issue was closed by revision 1b18a60.

Status changed to Fixed.

@rsc rsc added this to the Go1.1 milestone Apr 14, 2015

@rsc rsc removed the go1.1 label Apr 14, 2015

@golang golang locked and limited conversation to collaborators Jun 24, 2016

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants
You can’t perform that action at this time.