I have a stronger example on my main computer (currently inaccesible / put in boxes - I'm moving places).
However, I can remember of this one:
void testing()
{
int toto=32;
int u=1<<32; // gives u=0 - ok
int v=1<<toto; // gives u=1 instead of 0
}
Microsoft claims a correct result is not guaranteed with toto >= 32. I answered them: in this case, why do I see no compilation warning - you bunch of morons
For the record, this behavior is related with Intel's x86 SHR and SHL instructions - which are badly implemented since the 8086
This strange behavior (using VC++) was a major factor in the failure of digital signature authentication units for ballistic missiles in the U.S army.
Cheers