https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118593
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- I think the warning is correct here. Otherwise you get ~0/~1 which for most people is not what they are expecting even with the cast to unsigned.