Changes between Initial Version and Version 1 of Ticket #13192, comment 61


Ignore:
Timestamp:
Mar 27, 2015, 9:03:07 AM (4 years ago)
Author:
teor
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #13192, comment 61

    initial v1  
    1313
    1414See http://stackoverflow.com/a/22734721
    15 <blockquote>
     15{{{
    1616The result of E1 << E2 is E1 left-shifted E2 bit positions; vacated bits are filled with zeros. If E1 has an unsigned type, the value of the result is E1×2E2, reduced modulo one more than the maximum value representable in the result type. If E1 has a signed type and non-negative value, and E1×2E2 is representable in the result type, then that is the resulting value; otherwise, the behaviour is undefined.
    1717...
    1818If E1 is a signed type with negative value then the behaviour of left shifting is undefined. This is an easy route to undefined behaviour which may easily get overlooked.
    19 </blockquote>
     19}}}
    2020
    2121The tests then succeed on OS X 10.10.2 / Xcode 6.3 beta / clang 3.7.0 with integer undefined behaviour checks / x86_64.