Hi Jacob,

> > Assigning a negative number to uint32 doesn't necessarily work on all
> > platforms. I suggest using PG_UINT32_MAX.
>
> Hmm -- on which platforms is "-1 converted to unsigned" not equivalent
> to the maximum value? Are they C-compliant?

I did a little more research and I think you are right. What happens
according to the C standard:

"""
the value is converted to unsigned by adding to it one greater than the largest
number that can be represented in the unsigned integer type
"""

so this is effectively -1 + (PG_UINT32_MAX + 1).

-- 
Best regards,
Aleksander Alekseev


Reply via email to