Remix.run Logo
jbreckmckye 4 days ago

Some C programmers take the view that unsigneds have too many disadvantages: undefined behaviour for overflows, and weird type promotion rules. So, they try and avoid uints.

tekne 4 days ago | parent [-]

Umm, signed integers are UB on overflow; unsigned is always fine.

jbreckmckye 3 days ago | parent [-]

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.