Skip to content
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

add documentation for pointers to zero bit types #1561

Closed
winksaville opened this issue Sep 19, 2018 · 5 comments
Closed

add documentation for pointers to zero bit types #1561

winksaville opened this issue Sep 19, 2018 · 5 comments
Labels
Milestone

Comments

@winksaville
Copy link
Contributor

I don't have a clear understanding of what the semantics of u0 are, hence I'm openning this issue so that they can be discussed. This is an offshoot of #1554, #1549, #1530 and maybe others.

@andrewrk
Copy link
Member

Are you talking specifically about u0 or about 0-bit types in general?

@andrewrk andrewrk added the docs label Sep 19, 2018
@andrewrk andrewrk added this to the 0.4.0 milestone Sep 19, 2018
@andrewrk andrewrk changed the title Semantics of u0 add documentation for pointers to zero bit types Sep 19, 2018
@andrewrk
Copy link
Member

andrewrk commented Sep 19, 2018

  • mention that void, u0, enum with 1 tag, struct with all 0 bit fields, are all 0 bit types
  • document semantics of pointers to 0 bit types
  • example ?*void
  • example comparing 0 bit pointers
  • example u0 in packed struct

@winksaville
Copy link
Contributor Author

@andrewrk, sorry but you've changed the title in such a way that, to me you, are assuming the current semantics for u0 are correct, which I feel they may not be. It is my opinion that the semantics of u0 are more closely related to the semantics of u1..uN and have only incidental releationships with other types.

In anycase, I feel we should agree on the semantics of u0, u1, ... uN, whatever they may turn out to be, before we can answer your issue "add documentation for pointers to zero bit types".

If you agree, can you open another issue with a title something like "semantics of ux" or ...

As a starting point I've created the repo zig-ux-semantics with some tests for a subset of the possible semantics.

@andrewrk
Copy link
Member

@winksaville you are welcome to open a new issue with proposed, altered semantics.

@winksaville
Copy link
Contributor Author

txs, I'll do that. The proposal will be pretty simple, a u0 should have the same semantics as u1..u128. But I'll wait until I flesh out zig-ux-semantics to find out what works and what doesn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants