https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83151
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- So, the top bits are clear, thus ~ sets them and the conversion to unsigned certainly does change the sign. So, if you aren't interested in this kind of warning, don't enable it?