After doing some research I know in arithmetic expressions char and short will be promoted to int internally. But I am still wondering whether integer promotions like that will occur in assignment internally.
(So please don't give me links only concerning other expressions. I am asking about what happens internally in ASSIGNMENT expressions)
char ch1, ch2 = -1;
ch1 = ch2; // Q
Q: Which of the following will happen internally?
1, The value of ch1 is directly assigned to ch2. Integer promotions won't happen here.
2, The value of ch1 is first promoted to int type (8 bits→32bits), then the 32 bits value is demoted to char type, 8 bits, the final result. Integer promotions happen here.
I have found this book: C Primer Plus and in Page 174 there is:
"...When appearing in an expression, char and short, both signed and unsigned, are automatically converted to int, or if necessary, to unsigned int..."
So I think it should be 2, but I have heard someone told me it should be 1, where integer promotions don't happen.
I am really confused. Could you help me please? Thank you in advance.