I use gcc 4.8.3 under fedora 19 64bits
unsigned u1=10, u2=42;
unsigned short us1=10, us2=42;
int main() {
cout << "u1-u2="<<u1-u2<<", us1-us2="<<us1-us2<<endl;
}
Result : u1-u2=4294967264, us1-us2=-32
The << operator seems to interpret the result of the second operation as a signed short whereas it interprets the result of the first operation as an unsigned int