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.94.2) (envelope-from ) id 1rUTQW-00B7mo-JL for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Jan 2024 15:20:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rUTQT-00EyOS-5m for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Jan 2024 15:19: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.94.2) (envelope-from ) id 1rUTQS-00EyOJ-JP for pgsql-hackers@lists.postgresql.org; Mon, 29 Jan 2024 15:19: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.94.2) (envelope-from ) id 1rUTQM-003zKd-0v for pgsql-hackers@lists.postgresql.org; Mon, 29 Jan 2024 15:19:55 +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 40TFJl1A1784724; Mon, 29 Jan 2024 10:19:47 -0500 From: Tom Lane To: Peter Eisentraut cc: pgsql-hackers@lists.postgresql.org Subject: Re: PG versus libxml2 2.12.x In-reply-to: References: <1389505.1706382262@sss.pgh.pa.us> Comments: In-reply-to Peter Eisentraut message dated "Mon, 29 Jan 2024 15:56:12 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1784722.1706541587.1@sss.pgh.pa.us> Date: Mon, 29 Jan 2024 10:19:47 -0500 Message-ID: <1784723.1706541587@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Eisentraut writes: > On 27.01.24 20:04, Tom Lane wrote: >> I don't mind adopting the "const" --- it's a good idea in isolation. >> The trouble is in fixing our code to work with both old and new >> libxml2 versions. We could thrash around with a configure test or >> something, but I think the most expedient answer is just to insert >> some explicit casts, as shown in the attached. It's possible though >> that some compilers will throw a cast-away-const warning. I'm >> not seeing any, but ... > In PL/Tcl, we used to have these CONST84 and CONST86 things, for similar > reasons. Maybe that would be another approach. Yeah, if the simple cast approach turns out to create warnings, we'll have to fall back on using actually different declarations. I'm hoping to not have to go there. regards, tom lane