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 1vU7Xx-00HTxA-0m for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Dec 2025 18:07:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vU7Xv-008sxb-0E for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Dec 2025 18:07:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vU7Xu-008sxS-2S for pgsql-hackers@lists.postgresql.org; Fri, 12 Dec 2025 18:07:15 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vU7Xs-000Oma-3C for pgsql-hackers@postgresql.org; Fri, 12 Dec 2025 18:07:15 +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 5BCI78pC1026322; Fri, 12 Dec 2025 13:07:08 -0500 From: Tom Lane To: Peter Eisentraut cc: Thomas Munro , Tristan Partin , pgsql-hackers Subject: Re: On non-Windows, hard depend on uselocale(3) In-reply-to: References: <2946058.1700081498@sss.pgh.pa.us> <12842.1700083028@sss.pgh.pa.us> <98824.1700089582@sss.pgh.pa.us> <664255.1700245108@sss.pgh.pa.us> <810814.1700261928@sss.pgh.pa.us> <1155474.1700433384@sss.pgh.pa.us> <1330178.1700498443@sss.pgh.pa.us> <423491f5-2eaa-454e-8dc9-037d69c1a8f9@eisentraut.org> Comments: In-reply-to Peter Eisentraut message dated "Tue, 01 Oct 2024 08:04:07 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1026320.1765562828.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 12 Dec 2025 13:07:08 -0500 Message-ID: <1026321.1765562828@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Eisentraut writes: > On 28.08.24 20:50, Peter Eisentraut wrote: >> I suggest that the simplification of the xlocale.h configure tests coul= d = >> be committed separately. This would also be useful independent of this= , = >> and it's a sizeable chunk of this patch. > To keep this moving along a bit, I have extracted this part and = > committed it separately. I had to make a few small tweaks, e.g., there = > was no check for xlocale.h in configure.ac, and the old = > xlocale.h-including stanza could be removed from chklocale.h. Let's see= = > how this goes. For the archives' sake --- I discovered today during a "git bisect" session that commits between 35eeea623 ("Use thread-safe nl_langinfo_l(), not nl_langinfo()") and 9c2a6c5a5 ("Simplify checking for xlocale.h", the commit Peter refers to here) fail to build on current macOS (26/Tahoe): chklocale.c:330:8: error: call to undeclared function 'nl_langinfo_l'; ISO= C99 and later do not support implicit function declarations [-Wimplicit-f= unction-declaration] 330 | sys =3D nl_langinfo_l(CODESET, loc); | ^ chklocale.c:330:8: note: did you mean 'nl_langinfo'? /Library/Developer/CommandLineTools/SDKs/MacOSX26.1.sdk/usr/include/_langi= nfo.h:116:20: note: 'nl_langinfo' declared here 116 | char *_LIBC_CSTR nl_langinfo(nl_item); | ^ chklocale.c:330:6: error: incompatible integer to pointer conversion assig= ning to 'char *' from 'int' [-Wint-conversion] 330 | sys =3D nl_langinfo_l(CODESET, loc); | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 errors generated. This happens because nl_langinfo_l() is declared in xlocale.h, but chklocale.c elects not to #include that, evidently because it's no longer needed to obtain typedef locale_t. AFAICS there's nothing we can do about this retroactively; it'll be a more or less permanent landmine for bisecting on macOS. Fortunately it's not too difficult to work around, you can just do diff --git a/src/port/chklocale.c b/src/port/chklocale.c index 9506cd87ed8..0e35e0cf55f 100644 --- a/src/port/chklocale.c +++ b/src/port/chklocale.c @@ -23,9 +23,7 @@ #include #endif = -#ifdef LOCALE_T_IN_XLOCALE #include -#endif = #include "mb/pg_wchar.h" = when trying to build one of the affected commits. Another option that might fit into a bisecting workflow more easily is to inject -DLOCALE_T_IN_XLOCALE into CPPFLAGS. regards, tom lane