RFA: Small PATCH to add pow2p_hwi to hwint.h
Joseph Myers
joseph@codesourcery.com
Thu Sep 8 16:22:00 GMT 2016
On Thu, 8 Sep 2016, Jason Merrill wrote:
> Various places in GCC use negate, bit-and and compare to test whether
> an integer is a power of 2, but I think it would be clearer for this
> test to be wrapped in a function.
(x & -x) == x is also true for 0. Whatever the correct function semantics
for 0, the comment needs to reflect them.
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Gcc-patches
mailing list