Kyotaro Horiguchi <horikyota....@gmail.com> writes:
> At Thu, 17 Mar 2022 19:25:00 +0300, Maxim Orlov <orlo...@gmail.com> wrote in 
>> +/* printf/elog format compatible with 32 and 64 bit xid. */
>> +typedef unsigned long long          XID_TYPE;
>> ...
>> +     errmsg_internal("found multixact %llu from before relminmxid %llu",
>> +                     (XID_TYPE) multi, (XID_TYPE) relminmxid)));

> "(XID_TYPE) x" is actually equivalent to "(long long) x" here, but the
> point here is "%llu in format string accepts (long long)" so we should
> use literally (or bare) (long long) and the maybe-all precedents does
> that.

Yes.  Please do NOT do it like that.  Write (long long), not something
else, to cast a value to match an "ll" format specifier.  Otherwise
you're just making readers wonder whether your code is correct.

                        regards, tom lane


Reply via email to