pgsql: Modernize pg_bsd_indent's error/warning reporting code.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Modernize pg_bsd_indent's error/warning reporting code.
Date: 2026-06-15 16:23:05
Message-ID: E1wZA5Z-000RAx-18@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Modernize pg_bsd_indent's error/warning reporting code.

Late-model clang complains that these functions should be labeled
with "format(printf, 2, 3)", and it's right. But let's go a bit
further and also make use of varargs, to remove duplication and
allow these functions to be used with non-integer input values.

Since no good deed goes unpunished, I had to also adjust a couple
of call sites. They weren't wrong as-is, since the size_t-sized
arguments were coerced to int on the way into diag3(). But
without that, we have to adjust the format strings.

The point of this is to suppress compiler warnings, so back-patch
into branches containing pg_bsd_indent, even though there's no
functional change.

Author: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Reviewed-by: Ayush Tiwari <ayushtiwari(dot)slg01(at)gmail(dot)com>
Discussion: https://postgr.es/m/1645041.1781283554@sss.pgh.pa.us
Backpatch-through: 16

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/293de33ae5d098e4f77113fc89d741a19003f7b7

Modified Files
--------------
src/tools/pg_bsd_indent/indent.c | 4 ++--
src/tools/pg_bsd_indent/indent.h | 9 ++++++---
src/tools/pg_bsd_indent/io.c | 43 ++++++----------------------------------
3 files changed, 14 insertions(+), 42 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2026-06-15 17:08:05 pgsql: Doc: reword discussion of asterisk after table names in FROM.
Previous Message Heikki Linnakangas 2026-06-15 09:01:26 pgsql: Fix PQdescribePrepared with more than 7498 params