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 1qGCoo-0005iu-Ox for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Jul 2023 06:13:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qGCon-00081K-2G for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Jul 2023 06:13:49 +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 1qGCom-00081B-PT for pgsql-hackers@lists.postgresql.org; Mon, 03 Jul 2023 06:13:48 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qGCoj-001tUa-On for pgsql-hackers@postgresql.org; Mon, 03 Jul 2023 06:13:48 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 20F88320091F; Mon, 3 Jul 2023 02:13:42 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 03 Jul 2023 02:13:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1688364821; x=1688451221; bh=mT6P9JIIyfACTXnsrCBKQo1SA6n4LBtICIP 8xjH0wrw=; b=rdF5Q5gPK4EAC6eQPg+79ow6FSQ6N61/EZvWrsJCvDuIgKhI8eY epZi1UGO6z+NOh2lJhpUeyRnKkD1AcWnb+co4WRAF6TUGRf4WhXmhrirt9dOHbVR bVLBQSrNYWRCehsghrZcSLWRG5461qLWvjBHS0IBXKnf01I9E1AJu2LG9VPLmOVT 7wWzD1+DPByUy/gRIhs0qPhd5yOdndmeIu3ovLa47JUI7Z3lwd0y/RUkirzr0xWq 83icnx6tUOOFXjoCrxQXSeUiKSbQTMmvcx4sNBU3dpUDvz1Ql7N7Kqbc9zw5GlLo Z262Mgy+T8OUFs2g0SFQN92HySq3g7vmgQg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1688364821; x= 1688451221; bh=mT6P9JIIyfACTXnsrCBKQo1SA6n4LBtICIP8xjH0wrw=; b=L GVnLn61/Ae//Oc1BMsdLxFfcK97TaCNtYNTyBl//ZAX8tkpKQTS7glKCPMQ6yxHe SRe5ecWlxBmpXuAOrbBcGLQUboyyvPS+gOmcIsUnuGTotQ6HAlq92EfKktZZh3NS FAyq4xHevehCrcgr4rf6a+q/wjUd4BoRuQ/qVibeiROHYpegHLvPHlqJVM97NJ1y 7G+SC2l2i2kdt8Nt4kQOE8uESIeHTS+X4MkUhFMll6aBG3IF4Vzh5fUwttTmgNBp T4XY+82hJ5OKIKEYLcrYPRIuCwojlNQ46h56xfrWFMymr6yvVESiKiQjIY0mpOlB GxGv6bfl/uFRUGT+Gx6WQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedruddugddutdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthejredttdefjeenucfhrhhomheprfgvthgv rhcugfhishgvnhhtrhgruhhtuceophgvthgvrhesvghishgvnhhtrhgruhhtrdhorhhgqe enucggtffrrghtthgvrhhnpeeluefhgeeklefgvdekjeffhfeggeefgfettdeukeeuieev ueekkeetieeltdeludenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgnecuve hluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhes vghishgvnhhtrhgruhhtrdhorhhg X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 3 Jul 2023 02:13:40 -0400 (EDT) Message-ID: Date: Mon, 3 Jul 2023 08:13:40 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: Make uselocale protection more consistent Content-Language: en-US To: Tristan Partin , pgsql-hackers@postgresql.org References: From: Peter Eisentraut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 27.06.23 17:02, Tristan Partin wrote: > This is a patch which implements an issue discussed in bug #17946[0]. It > doesn't fix the overarching issue of the bug, but merely a consistency > issue which was found while analyzing code by Heikki. I had originally > submitted the patch within that thread, but for visibility and the > purposes of the commitfest, I have re-sent it in its own thread. > > [0]: https://www.postgresql.org/message-id/49dfcad8-90fa-8577-008f-d142e61af46b@iki.fi I notice that HAVE_USELOCALE was introduced much later than HAVE_LOCALE_T, and at the time the code was already using uselocale(), so perhaps the introduction of HAVE_USELOCALE was unnecessary and should be reverted. I think it would be better to keep HAVE_LOCALE_T as encompassing any of the various locale_t-using functions, rather than using HAVE_USELOCALE as a proxy for them. Otherwise you create weird situations like having #ifdef HAVE_WCSTOMBS_L inside #ifdef HAVE_USELOCALE, which doesn't make sense, I think.