]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Modernize pg_bsd_indent's error/warning reporting code.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 15 Jun 2026 16:22:55 +0000 (12:22 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 15 Jun 2026 16:22:55 +0000 (12:22 -0400)
commit82140a71dbf869ca2d7173af601f801cdd8b0044
tree9004901af7990f55fee5f7c2256715dbd07b5688
parent8d516d2b99b355bc1fb6b84f7dd0d5460c00c93f
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@sss.pgh.pa.us>
Reviewed-by: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Discussion: https://postgr.es/m/1645041.1781283554@sss.pgh.pa.us
Backpatch-through: 16
src/tools/pg_bsd_indent/indent.c
src/tools/pg_bsd_indent/indent.h
src/tools/pg_bsd_indent/io.c