Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wZA9K-000oxC-0j for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Jun 2026 16:26:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wZA9J-00CeX1-0R for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Jun 2026 16:26:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wZA9I-00CeWt-2J for pgsql-hackers@lists.postgresql.org; Mon, 15 Jun 2026 16:26:56 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wZA9H-00000000V6q-1rg5 for pgsql-hackers@lists.postgresql.org; Mon, 15 Jun 2026 16:26:55 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 65FGQrbM235696; Mon, 15 Jun 2026 12:26:53 -0400 From: Tom Lane To: Ayush Tiwari cc: pgsql-hackers@lists.postgresql.org Subject: Re: Modernizing pg_bsd_indent's error/warning reporting code In-reply-to: References: <1645041.1781283554@sss.pgh.pa.us> Comments: In-reply-to Ayush Tiwari message dated "Sat, 13 Jun 2026 01:35:23 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <235694.1781540813.1@sss.pgh.pa.us> Date: Mon, 15 Jun 2026 12:26:53 -0400 Message-ID: <235695.1781540813@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Ayush Tiwari writes: > On Fri, 12 Jun 2026 at 22:29, Tom Lane wrote: >> This is not an unreasonable suggestion, and presumably more people >> will start seeing this as they adopt newer clang versions. (I see >> the same on Fedora 44, for instance.) So I think we ought to take >> the advice, and while we're at it let's convert this code to use >> varargs instead of several duplicative functions. Patch attached. > Patch looks good to me, Thanks for looking! > Just a minor comment, while we are at it, should we change > the %zd to %zu for nitems since it looks like it uses size_t? Seems reasonable enough. It can't matter functionally, since the denominators in nitems() are surely at least 2. But it is indeed customary to print size_t with %zu, so done that way. regards, tom lane