agora inbox for pgsql-committers@postgresql.orghelp / color / mirror / Atom feed
pgsql: Modernize pg_bsd_indent's error/warning reporting code. 4+ messages / 1 participants [nested] [flat]
* pgsql: Modernize pg_bsd_indent's error/warning reporting code. @ 2026-06-15 16:23 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2026-06-15 16:23 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/ca6969629d8526706ba0368b0063ddca86ed1f3e 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(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Modernize pg_bsd_indent's error/warning reporting code. @ 2026-06-15 16:23 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2026-06-15 16:23 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ REL_18_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/6603e81e69e9b7378e2581f436119a7c6cb94cf9 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(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Modernize pg_bsd_indent's error/warning reporting code. @ 2026-06-15 16:23 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2026-06-15 16:23 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 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(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Modernize pg_bsd_indent's error/warning reporting code. @ 2026-06-15 16:23 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2026-06-15 16:23 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ REL_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/82140a71dbf869ca2d7173af601f801cdd8b0044 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(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2026-06-15 16:23 UTC | newest] Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2026-06-15 16:23 pgsql: Modernize pg_bsd_indent's error/warning reporting code. Tom Lane <tgl@sss.pgh.pa.us> 2026-06-15 16:23 pgsql: Modernize pg_bsd_indent's error/warning reporting code. Tom Lane <tgl@sss.pgh.pa.us> 2026-06-15 16:23 pgsql: Modernize pg_bsd_indent's error/warning reporting code. Tom Lane <tgl@sss.pgh.pa.us> 2026-06-15 16:23 pgsql: Modernize pg_bsd_indent's error/warning reporting code. Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox