Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1obYZN-0003DW-DQ for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Sep 2022 02:37:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1obYZL-00080a-9D for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Sep 2022 02:37:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1obYZK-00080R-Vw for pgsql-hackers@lists.postgresql.org; Fri, 23 Sep 2022 02:37:34 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1obYZI-0008Di-TF for pgsql-hackers@postgresql.org; Fri, 23 Sep 2022 02:37:34 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 28N2bTUr2032646; Thu, 22 Sep 2022 22:37:29 -0400 From: Tom Lane To: Peter Eisentraut cc: Andres Freund , pgsql-hackers Subject: Re: libpq error message refactoring In-reply-to: References: <7c0232ef-7b44-68db-599d-b327d0640a77@enterprisedb.com> <20220922154225.q4rtgzzsq6pd4f5x@awork3.anarazel.de> Comments: In-reply-to Peter Eisentraut message dated "Thu, 22 Sep 2022 22:00:00 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2032644.1663900649.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 22 Sep 2022 22:37:29 -0400 Message-ID: <2032645.1663900649@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Eisentraut writes: > On 22.09.22 17:42, Andres Freund wrote: >> It's not the cause of this failure, I think, but doesn't appendPQExpBuf= ferVA >> need to be added to exports.txt? > I don't want to make that function available to users of libpq, just use= = > it inside libpq across .c files. Is there no visibility level for that?= = Should "just work", I should think. I agree with Andres that that's not the cause of the build failure. I wonder if somehow the failing links are picking up the wrong libpq.a. Separately from that: is it really okay to delegate use of a va_list argument like that? The other call paths of appendPQExpBufferVA[_internal] write va_start/va_end directly around it, not somewhere else in the call chain. I'm too tired to language-lawyer out what happens when you do it like this, but I'm suspecting that it's not well-defined portable behavior. I think what you probably need to do is export appendPQExpBufferVA as-is and require libpq_append_error to provide the error loop. regards, tom lane