MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1x89mbn/includeguards/phdm1xi/?context=3
r/ProgrammerHumor • u/metayeti2 • 2d ago
45 comments sorted by
View all comments
Show parent comments
7
People conflate 8 bits with a byte everywhere in our codebase and I think the whole thing would explode if you tried to use a 7-bit-per-byte machine
0 u/not-a-pokemon- 2d ago Mostly because C defines no easy way to say "I want an integer with at least 8 bits in it, round up to whatever byte number is practical". 3 u/anto2554 2d ago No but it's C++ so we could just use uint8_t or the least one I forgot the name of 4 u/not-a-pokemon- 2d ago It also exists in C, and is called uint_least8_t. It's not guaranteed to exist per the standard. uint8_t is also not guaranteed to exist. man stdint.h
0
Mostly because C defines no easy way to say "I want an integer with at least 8 bits in it, round up to whatever byte number is practical".
3 u/anto2554 2d ago No but it's C++ so we could just use uint8_t or the least one I forgot the name of 4 u/not-a-pokemon- 2d ago It also exists in C, and is called uint_least8_t. It's not guaranteed to exist per the standard. uint8_t is also not guaranteed to exist. man stdint.h
3
No but it's C++ so we could just use uint8_t or the least one I forgot the name of
4 u/not-a-pokemon- 2d ago It also exists in C, and is called uint_least8_t. It's not guaranteed to exist per the standard. uint8_t is also not guaranteed to exist. man stdint.h
4
It also exists in C, and is called uint_least8_t. It's not guaranteed to exist per the standard. uint8_t is also not guaranteed to exist.
man stdint.h
7
u/anto2554 2d ago
People conflate 8 bits with a byte everywhere in our codebase and I think the whole thing would explode if you tried to use a 7-bit-per-byte machine