Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: minor editorial change

...

Although shifting a negative number of bits or or shifting a number of bits greater than or equal to the width of the promoted left operand is undefined behavior in C, the risk is generally low because processors frequently reduce the shift amount modulo the width of the type.

...

Bibliography

[C99 Rationale 2003]6.5.7, "Bitwise Shift Operators"
[Dowd 2006]Chapter 6, "C Language Issues"
[Seacord 2013b]Chapter 5, "Integer Security"
[Viega 2005]Section 5.2.7, "Integer Overflow"

...