pgsql: Use PRI*64 instead of "ll*" in format strings (minimal trial) - Mailing list pgsql-committers

From Peter Eisentraut
Subject pgsql: Use PRI*64 instead of "ll*" in format strings (minimal trial)
Date
Msg-id E1toiyk-000R0U-1o@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Use PRI*64 instead of "ll*" in format strings (minimal trial)

Old: errmsg("hello %llu", (unsigned long long) x)
New: errmsg("hello %" PRIu64, x)

And likewise for everything printf-like.

In the past we had to use long long so localized format strings remained
architecture independent in message catalogs.  Although long long is
expected to be 64 bit everywhere, if we hadn't also cast the int64
values, we'd have generated compiler warnings on systems where int64 was
long.

Now that int64 is int64_t, C99 understand how to format them using
<inttypes.h> macros, the casts are not necessary, and the gettext()
tools recognize the macros and defer expansion until load time.  (And if
we ever manage to get -Wformat-signedness to work for us, that'd help
with these too, but not the type-system-clobbering casts.)

This particular patch converts only pg_checksums.c to the new system,
to allow testing of the translation toolchain for everyone.  If this
works okay, a later patch will convert most of the rest.

Author: Thomas Munro <thomas.munro@gmail.com>
Discussion: https://postgr.es/m/b936d2fb-590d-49c3-a615-92c3a88c6c19%40eisentraut.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/15a79c73111f0c9738ee81b796f7de5bfeb3aedc

Modified Files
--------------
src/bin/pg_checksums/pg_checksums.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Fix pg_strtof() to not crash on NULL endptr.
Next
From: Fujii Masao
Date:
Subject: pgsql: postgres_fdw: Extend postgres_fdw_get_connections to return remo