-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
allow implicit cast from *T to ?*c_void #433
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
Comments
This looks both convenient for reducing clutter in code, and should be perfectly safe, but seeing the cast to |
I've been interfacing with more and more C code and especially with the new developments around casting I think this feature would be pretty welcome. |
I appreciate that feedback. What do you think about the proposal to add another pointer type specifically for C interop? #1059 |
Yet another pointer type sounds awful, but the convenience of not having to manually correct your imports is really tempting... I think Zig has to do everything it can to make C interop completely seamless. I'll comment more on that issue's thread. Since any 'real' binding to a C library need work beyond what translate-c can do, any problems inherent to this kind of pointer won't be an issue for 'real code'. I say go for it. |
implemented in e2a9f2e by @raulgrell |
Should we allow implicitly casting pointers to
?*c_void
?The text was updated successfully, but these errors were encountered: