2012/3/22 Andreas Schwab <address@hidden>
Yes, it can overflow.
Fabrice Popineau <address@hidden
> You mean you can't negate a signed int ?
Well ... the range is not wider with an unsigned int.
Maybe I'm too naive but if x is unsigned, I don't expect to
see -x . The implicit semantics for unsigned is x >= 0.
Sorry to be so stubborn, but I hate those sign extensions that can arise
anywhere. My point is that even if the effect is intended by using unsigned
this way, if the same variable is upgraded to long, the sign extension will
occur, probably unintented, and not flagged harder by the compiler.