Hacker News new | ask | show | jobs
by tekne 267 days ago
Umm, signed integers are UB on overflow; unsigned is always fine.
1 comments

Sorry, you are correct. I don't think unsigned overflow behaviour was defined until C99 though.

Anyway, in answer to the question, I would guess the reason was because of signed / unsigned type promotion.