Chris said:
James, I find it a little difficult to follow your argument
(you seem to be arguing against both sides).
Is there a rule that says there only have to be two sides?
The point I raised is not inconsistent with anything Richard has said,
though his failure to raise the same point suggests that he might not
have thought about it. Alternatively, the comments he has made so far
might have been intended as a roundabout way of raising that same point
- this would not be an unusual way of doing things for him.
However, my response goes directly against your suggestion of using
PRId64. So if I must choose sides, it would seem to me that I have.
The OP asked about 64-bit integers, it's there in the subject line.
I believe that the discussion around long long is a red herring.
Yes, there is one reference to 64-bit integers in the Subject: header,
but none in the message itself, which contains two uses of long long,
and two uses (that should have been four) using %lld. I think it's
pretty clear that the OP conflated 64-bit integers with long long; for
that reason alone, it would be useful to point out the distinction
between the two concepts.
It's not clear, if he were aware of the distinction, which of the two
things his question would really have been about. However, since long
long is referred to more frequently that 64-bit, my guess is that he
would have re-written the subject line to match the body of his message,
and not vice-versa.
More directly to the point, the suggestion of using PRId64 should not
have been made without an accompanying recommendation that he replace
long long with int64_t, or at least do a cast in the printf()
statements. If he is going to use int64_t, the code should also contain
a test of one of the appropriate macros to ensure that it's actually
available. Note that the possible unavailability of PRId64, which
Richard was talking about, is directly related to the possible
unavailability of int64_t.