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/go: rewrite *_Ctype_int in cgo error message #6781

Closed
dominikh opened this issue Nov 17, 2013 · 7 comments
Closed

cmd/go: rewrite *_Ctype_int in cgo error message #6781

dominikh opened this issue Nov 17, 2013 · 7 comments

Comments

@dominikh
Copy link
Member

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. Compile http://play.golang.org/p/MlxBDNUgP6
2.
3.

What is the expected output?
./foo.go:8: cannot use i (type *C.int) as type C.size_t in function argument

What do you see instead?
cannot use i (type *_Ctype_int) as type C.size_t in function argument

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
Linux

Which version are you using?  (run 'go version')
go version devel +341a490e4736 Fri Nov 08 11:31:44 2013 -0500 linux/amd64

Please provide any additional information below.
Using the type names that cgo uses internally doesn't help in understanding the, at
times, already not that easy to understand errors that cgo produces. This can especially
trip up people who are experimenting with cgo for the first time.

The issue is made worse by the fact that half of the error uses the internal format
(`*_Ctype_int`) while the other half uses the same format as used in actual Go code
(`C.size_t`)
@robpike
Copy link
Contributor

robpike commented Nov 18, 2013

Comment 1:

Labels changed: added priority-later, removed priority-triage.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 2:

The rewrite of "type _Ctype_int" to "type C.int" happens in cmd/go/build.go, around line
1300.
The rewrite needs to be changed to handle this case too.

@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 3:

Labels changed: added go1.3maybe.

@minux
Copy link
Member

minux commented Dec 3, 2013

Comment 4:

https://golang.org/cl/36860043/

Owner changed to @minux.

Status changed to Started.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 5:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 6:

Labels changed: added repo-main.

@minux
Copy link
Member

minux commented Feb 13, 2014

Comment 7:

This issue was closed by revision c36dd4a.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 25, 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
Development

No branches or pull requests

5 participants