Yeah, this is why I don't understand why some prefer to use ~0u even if the type is unsigned, which will break with sizes larger than int. To me ~0 pattern means "all 1s", but if 0 is unsigned, then it will get zero extended to 64-bits, so result would be 0x00000000ffffffff, which is wrong. So it's fragile.
It's also 1 extra character. ;)