I have heard that shifting into signed bit of an integer, i.e.
int test = INT_MAX;
test = (test<<1) + 1;
is undefined behaviour due to test being greater than INT_MAX. But will this behaviour be encountered in signed short variables, i.e.
short test1 = SHRT_MAX;
test1 = (test1<<1) + 1;
?
At the moment I have not come across any relevant documentation.
EDIT: I know that undefined behaviour will result in the case of integers, but not of short.