this post was submitted on 03 Nov 2025
123 points (96.2% liked)
Programming
23394 readers
213 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities !webdev@programming.dev
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Emulation code where you expect unsigned integers to wrap around instead of being UB is a good example, because it was guaranteed for programmers working on the emulated systems.
That's just how it works and have always worked. You can use an unsigned char on a 64 bit system and it'll behave like on the Commodore 64. I don't understand what you are trying to show.
When a system uses words of a specific size, you need to use the same size for wraparound behaviour to work as expected. Incrementing 0xffff by one needs to return 0. It's easy if you use a uint16_t. Not so much if you use an unsigned of unspecified length.
We are in a total agreement here.