The following doesn\'t give me any warning whatsoever when compiled with gcc 4.5.2 on x86 machine with Linux:
char foo = 255;
But when I us
Signed integer overflow causes undefined behavior only when it occurs when evaluating intermediate results of arithmetic expressions, e.g. during binary mutiplication, unary decrement etc. Also, converting floating-point value to integer type causes undefined behavior if the value is out of range.
An overflowing integral conversion to signed type does not cause undefined behavior. Instead it produces implementation-defined result (with the possibility of an implementation-defined signal being raised).