Semantics of bit inversion operator
what is the return type of the operator~ for integral types? I thought no promotion needs to be done here, but from a question to the gcc-help mailing list I got the following explanations:
The problem is that the operator "~" when applied upon the unsigned
char returns always a signed char.
So my questions are
Integral promotions are performed for operator ~ and int can represent
all the values of unsigned char, so the operand is promoted to int.
- what are the promotion rules for bit inversion regarding integral types?
- is this behaviour implementation defined?