pgsql: Fix unportable usage of printf("%m").

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix unportable usage of printf("%m").
Date: 2018-05-20 22:06:49
Message-ID: E1fKWTZ-0000ri-Jo@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix unportable usage of printf("%m").

While glibc's version of printf accepts %m, most others do not;
to be portable, we have to do it the hard way with strerror(errno).
pg_verify_checksums evidently did not get that memo.

Noted while fooling around with NetBSD-current, which generates
a compiler warning for this mistake.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/a13b47a59ffce6f3c13c8b777738a3aab1db10d3

Modified Files
--------------
src/bin/pg_verify_checksums/pg_verify_checksums.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2018-05-21 04:33:04 pgsql: Fix unsafe usage of strerror(errno) within ereport().
Previous Message Tom Lane 2018-05-20 15:41:19 pgsql: printf("%lf") is not portable, so omit the "l".