>Спрашивайте в maillist'ах gcc. Это проявляется только с -Ox и не проявляется
>на любых версиях gcc на FreeBSD. Нашёл откуда ноги растут
int main() {
unsigned short int x, y;
x = y << 8;
return 0;
}
# gcc -O0 -Wconversion test.c
# ./a.out
Как говорит ISO/IEC 9899:201x, стр. 85., §6.5.7 Bitwise shift operators
> 2. Each of the operands shall have integer type.
Вот и орёт.
А дальше ещё интереснее...
> 3. The integer promotions are performed on each of the operands.
> The type of the result is that of the promoted left operand.
А у меня левый unsigned short :)
> If the value of the right operand is negative or is greater
>than or equal to the width of the promoted left operand, the behavior is undefined.