-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
@ptrCast between real pointers and 0-sized pointers should be a compile error #1469
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
Labels
Milestone
Comments
@thejoshwolfe I think I was implementing some vtable/interface stuff. Was trying to use |
tadeokondrak
added a commit
to tadeokondrak/zig
that referenced
this issue
Sep 26, 2020
tadeokondrak
added a commit
to tadeokondrak/zig
that referenced
this issue
Sep 26, 2020
tadeokondrak
added a commit
to tadeokondrak/zig
that referenced
this issue
Sep 30, 2020
Casting from normal pointers to pointers to zero-length arrays seems to be reasonable code, which happens in std.heap.GeneralPurposeAllocator. |
In #6706 we've decided to remove 0-sized pointers, so this is no longer relevant. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This came up in #960.
This should be a compile error. A
*void
has 0 size (just likevoid
itself) so this cast makes no sense.@Hejsil was there a usecase you were running into in #960 where you wanted to do this cast?
The text was updated successfully, but these errors were encountered: