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

Disambiguate "byte" size #1673

Open
Rudxain opened this issue Nov 13, 2024 · 1 comment
Open

Disambiguate "byte" size #1673

Rudxain opened this issue Nov 13, 2024 · 1 comment

Comments

@Rudxain
Copy link

Rudxain commented Nov 13, 2024

The Glossary and "Type Layout" don't specify the size of a "byte".

  • Was that intentional?
  • Is it a real byte? (platform-dependent smallest unit of addressable memory?)
  • Is it guaranteed to be an octet?

I think it's worth being explicit about that.

BTW, the bool reference seems somewhat contradictory:

  • size_of::<bool>() == 1 implies platform-dependent byte
  • The hexadecimal bit-patterns imply u8 (guaranteed octet)

IMO, bytes are more honest and correct than octets (for bool and some enums, at least). For primitives such as char and u8, and exact bit-count is better than bytes

@Rudxain Rudxain changed the title Disambiguate "byte" size for all docs Disambiguate "byte" size Nov 13, 2024
@bjorn3
Copy link
Member

bjorn3 commented Nov 13, 2024

I don't think we support any target where a byte is anything other than 8 bits, just like we don't support any systems that use something other than two's complement for signed integers.

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

No branches or pull requests

2 participants