[Bug c/83122] -Wconversion and shifting bitwise

lh_mouse at 126 dot com gcc-bugzilla@gcc.gnu.org
Thu Nov 23 11:11:00 GMT 2017


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

--- Comment #2 from Liu Hao <lh_mouse at 126 dot com> ---
Yes it is hard to tell whether there is indeed loss of precision.

At the moment, the (only?) redictable way to silence the warning is to use a
bitwise and operation. That is, `ptr->b = (val >> 3) & (UINT64_MAX >> 3)`.


More information about the Gcc-bugs mailing list