The unary minus operand first undergoes standard promises, so it is of type int , which can represent the value -128 . The result of the operation is a value of 128 , also of type int . The conversion from int to signed char , which is the narrowing of signed types, is determined by the implementation.
(Your implementation seems to do a simple migration: 125, 126, 127, -128, -127, ...)
source share