-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: link error when binding C.malloc to a Go variable #18889
Comments
Note that it works if you don't use the magic function |
Hmm, interesting! Didn't occur to me that |
cgo converts Should we support using their references or an error message would be enough? |
An error message would probably suffice. IMO it's odd that we wrap |
At this point, I know of two reasons for the continued special wrapping of
|
CL https://golang.org/cl/40934 mentions this issue. |
This program fails to build at the linking step:
src/mallocvar/mallocvar.go:
If the program is invalid, it should be rejected earlier and produce a more helpful error message. (For example, changing
C.malloc
toC.monkeypants
produces the messagecould not determine kind of name for C.monkeypants
, which is arguably more helpful.)If the program is valid, it should link successfully.
(attn: @ianlancetaylor)
The text was updated successfully, but these errors were encountered: