Is Shifting more than 32 bits of a uint64_t integer on an x86 machine Undefined Behavior?
问题 Learning the hard way, I tried to left shift a long long and uint64_t to more than 32 bits on an x86 machine resulted 0 . I vaguely remember to have read somewhere than on a 32 bit machine shift operators only work on the first 32 bits but cannot recollect the source. I would like to know is if Shifting more than 32 bits of a uint64_t integer on an x86 machine is an Undefined Behavior? 回答1: The standard says (6.5.7 in n1570): 3 The integer promotions are performed on each of the operands. The