On 3/26/2018 2:00 PM, Junio C Hamano wrote:
Jeff Hostetler <git@xxxxxxxxxxxxxxxxx> writes:
I am concerned that the above compiler error message says that uintmax_t
is defined as an "unsigned long" (which is defined as *at least* 32 bits,
but not necessarily 64. But a uint64_t is defined as a "unsigned long long"
and guaranteed as a 64 bit value.
On a platform whose uintmax_t is u32, is it realistic to expect that
we would be able to use u64, even if we explicitly ask for it, in
the first place?
In other words, on a platform that handles uint64_t, I would expect
uintmax_t to be wide enough to hold an uint64_t value without
truncation.
I was just going by what the reported compiler error message was.
It said that "unsigned long" didn't match the uint64_t variable.
And that made me nervous.
If all of the platforms we build on define uintmax_t >= 64 bits,
then it doesn't matter.
If we do have a platform where uintmax_t is u32, then we'll have a
lot more breakage than in just the new function I added.
Thanks,
Jeff