Question: is integer overflow undefined behaviour?
Answer: In languages like C, unsigned integer overflow reliably wraps around; e.g., UINT_MAX + 1 yields zero. ... In contrast, the C standard says that signed integer overflow leads to undefined behavior where a program can do anything, including dumping core or overrunning a buffer. The misbehavior can even precede the overflow.