On Fri Feb 10 13:39:27 2023 +0000, Rémi Bernon wrote:
I will add some constant definitions to make it more explicit.
For GCC/Clang/MSVC we can be confident that `~0 == -1`, since we assume two's complement representation sans padding and trap bits. Also, C's integer promotion rules dictate that a smaller signed operand of a comparison shall be coerced to the type of the bigger unsigned operand. The two's complement conversion takes place _after_ widening; thus, `-1` is sign-extended to `(UINT64)-1`.