https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70389

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
For unsigned short x <<= 1U is after integral promotions
x = (((int) x) << 1U);
and -Wconversion warns about the conversion of the int value to unsigned short.
Consider e.g. x being 0x8000, x << 1U then is 0x10000 and the implicit
conversion alters the value.
If x is unsigned int, there is no promotion, so if x is e.g. 0x80000000U, then
x << 1U is 0 and nothing is altered.

Reply via email to