3 ms·
> Who said overflow was wrong? The word "overflow". > It’s also basically impossible to establish invariants about a system for code that is run in signal han
by Dylan16807 3y ago
> Who said overflow was wrong?
The word "overflow".
> It’s also basically impossible to establish invariants about a system for code that is run in signal handlers
Signals are a pain but it doesn't specifically have to be a signal.
- nynx 3y agoOverflow is perfectly well defined in most languages. What could it be other than a signal?
- eru 3y agoAlas, it's not well defined for signed integers in C (and C++) which are still popular languages.
- Dylan16807 3y ago> What could it be other than a signal? A normal exception without stack gremlins trying to break everything.
- kelnos 3y agoOverflow is fine if you're aware of it and have code that either doesn't need to care about it, or can work around it. Consider protocols with wrapping sequence numbers. Pretty common in the wild. If I increment my 32-bit sequence counter and it goes from 2^32-1 back to 0, that's likely just expected behavior.