-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Why isn't using *void
in a struct field an error?
#16444
Comments
discussion in #6706 |
prior to that pointer-to-zero-sized were still valid but also zero-sized |
I can see an argument to be made for allowing But are there any cases where writing |
More discussion in #12075. |
|
Zig Version
0.11.0-dev.4006+bf827d0b5
Steps to Reproduce and Observed Behavior
Let's say you're writing some C/C++ and without noticing, you have this in your Zig:
*void
was replaced by*anyopaque
many months ago, but this code compiled successfully.zig test repro.zig All 1 tests passed.
Is
*void
a valid alternative to*anyopaque
? If yes, why are there two (which goes against the philosophy of only one way to do things)? If no, why does this code compile successfully?Expected Behavior
The code should not compile successfully
The text was updated successfully, but these errors were encountered: