-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: cannot call functions with variable-argument lists. #975
Comments
I'm not sure this will ever work. It's very hard to type check and do correctly. Labels changed: added priority-low, removed priority-medium. Owner changed to r...@golang.org. Status changed to LongTerm. |
I think this should be documented as it is a long-term issue. While wiki says:
The documentation of cgo should be more explicit for the issue, but now it not even mention this. |
@LionNatsu, please file a new bug just for documenting that. It's true that I see nothing at https://golang.org/cmd/cgo/ about variadic args. |
Change https://golang.org/cl/90415 mentions this issue: |
The current implementation does not support calling C variadic functions (as discussed in #975). Document that. Fixes #23537 Change-Id: If4c684a3d135f3c2782a720374dc4c07ea66dcbb Reviewed-on: https://go-review.googlesource.com/90415 Reviewed-by: Ian Lance Taylor <iant@golang.org>
The current implementation does not support calling C variadic functions (as discussed in golang#975). Document that. Fixes golang#23537 Change-Id: If4c684a3d135f3c2782a720374dc4c07ea66dcbb Reviewed-on: https://go-review.googlesource.com/90415 Reviewed-by: Ian Lance Taylor <iant@golang.org>
…) that supports only one tag as cgo does not support functions with variable-argument lists (see golang/go#975)
This would help with @progrium's MacDriver: https://dev.to/progrium/use-mac-apis-and-build-mac-apps-with-go-ap6 /cc @ianlancetaylor |
n order to implement this, we need to be able to rewrite
into a call to a generated Go function
which means that we need to generate
and similarly for a C wrapper function. That is all fine, but in order to write these functions we need to know the types of the Go arguments. Normally we can simply use the types of the C function parameters, which we can get from the C debug info. But of course for a C variadic function we have no type information for the variadic arguments. That means that we need to use the types of the Go arguments. But currently cgo does not know those types. So I think this has to wait for #16623. |
by akidan:
The text was updated successfully, but these errors were encountered: