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 1rB4FL-009JWo-Md for pgsql-bugs@arkaria.postgresql.org; Thu, 07 Dec 2023 02:36:16 +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 1rB4FI-00EL54-V2 for pgsql-bugs@arkaria.postgresql.org; Thu, 07 Dec 2023 02:36:12 +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 1rB4C4-00EHwv-OH for pgsql-bugs@lists.postgresql.org; Thu, 07 Dec 2023 02:32:53 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rB4C0-009B0r-KW for pgsql-bugs@lists.postgresql.org; Thu, 07 Dec 2023 02:32:50 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 7B20A3200A3A; Wed, 6 Dec 2023 21:32:46 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 06 Dec 2023 21:32:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc: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=1701916365; x=1702002765; bh=bE orKdq3CvHu1Oo7MEvKiunayQ9epyCf2wGwTz3Ymr8=; b=tvF3hHpFA5Espz2nmo gjmDiQ+EUHahNwVg1S5slbvdvfXqetjz8za+WSmRIpZv1AL9sZ/U1YB6Rjjcj3RK Hs/PY7CcuCvqGDzaqGfGdP7nIQXCBHJy3Q5rzfgodW5kyApBY6MtNnr1LsK+eYqq S6MMKXNJrL2PZhCPiFBvKAW7aQ24gLDFEGfnAB3sYGjl+Xc2X+XyYuwRb/APITeS UutW10+Mkpbu5U8EaIkgjqHvaI7UiabZVGEnH+/m2MtsNHfGq6H0JsvwHokJ5PrD duRXC3ZaP/Q7aX7Q/0BVANa8zrSP3U+kzTws6DXooiPpgJoj8LgwopCMDLZEbiy7 O+wA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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=fm1; t=1701916365; x=1702002765; bh=bEorKdq3CvHu1 Oo7MEvKiunayQ9epyCf2wGwTz3Ymr8=; b=E0yypn3FfQCYbzmAuaf6DHPI3MESs 3tLkE/VpqJoYc6gCymZnreQ08JrOiuRKRyWatEp0iRc4ewdCjoohNe1SC4TCDYuR ZVhr/N0JWv5S/ozTLR5VhV//ynDu+gvTKsgKFjxAKh7kQQ1vJgtS7ZsJjpa8fLwx RHOjR0LFXq8rUVPELPY8b90fnD5ygWCCtrSwbtG44ufFWVLVAkelytvJuX9pmUv+ NTh8SemwBsMbbN7mEtub+L1KjXRv4PUmWBakJS8UTz7NptYJeYwXuDP1tMsY3r37 g9ZbZf1Id0J/U2L+PxCgHEVDDDDUg8/cvak2oKDLx8bYu7qqrBTAqo3rw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudekuddggeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeg geegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 6 Dec 2023 21:32:44 -0500 (EST) Date: Thu, 7 Dec 2023 11:32:33 +0900 From: Michael Paquier To: Richard Guo Cc: RekGRpth , Laurenz Albe , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18230: Redundant comparison of a local variable 'tzp' address with a NULL value at dt_common.c Message-ID: References: <18230-c68eb05e05cb9177@postgresql.org> <51a453dfe23d1b7f33c2d9b495a4c6eb972da61e.camel@cybertec.at> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="0CCZsdKjKFoETjui" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0CCZsdKjKFoETjui Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Dec 07, 2023 at 09:51:57AM +0800, Richard Guo wrote: > There are several places in DecodeDateTime() where the value of '*tzp' > is changed. It seems to me that these assignments are unnecessary since > the value of '*tzp' is not utilized anywhere in the code. Can we also > remove these assignments? *tzp could be given to DecodeTimezone() and manipulated inside it, but you are right that we don't use it at all in the DecodeDateTime() path. Other callers of DecodeTimezone() may depend on the changes done inside it, though. Perhaps DecodeTimezone() should be extended so as it can accept a NULL value and use that in DecodeDateTime(), eliminating the need for *tzp entirely? -- Michael --0CCZsdKjKFoETjui Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmVxLsEACgkQnvQgOdby QH13cxAAjL2p3uJz8O8SNXgpgk/NbG8WsWHae94ChnDbOAD9MZBMOErP04W8XDZq dXTuZdXvLUybB40OSDu6wv+yh+/RGtlaWLHzo4v5JKclhRw0yO8R6ZqQs+vb0ajf tcdvIKfJrL46DjYhNI5xXy7kMidQ47PAYS4a1bOsLttR015EA5LdoJXjJQsuEZHH aZsrwBHVno/OmyjoNDyoCrHr2C4Xi1pwjo4Tob9VcCDxJAofya4N9YF4ru8+xp7Q zH20GrKhinTDHKsIo9OhwaGZjpPuffCZcivSTX7bxI8yuRGOiCLkG5vQjtkyJqfS MfEr3QAdIxhf3/CbYbuaH/jOdkqALxT0DtFBj93QHCcuEOocA9axXLVqz8FP9Jei aLZTjzai7J/Yv6hjHf2pclM8LClgAK9CHH/h4fo7k9KAYZOvoWlCskvdLkkYXkpI vf1Yk4NkHI65LxXAbrxzy8Lpc6pCRCh1Ve6vTXVxAKy6trm4BnPheNSrbyqo+C+s VlazRSVTMsgiNNwUi4eSQ3HMGZFCWOsmyleVmb9P0nL/vrTB6LHhxVNouHKz3nTc +yFplEsMC5PujgTruny6cEDW45B9xDgJZV20G7z+Lwek+h+1iI2XWerO1HyJDE3p 6IGa8+m6J5dTPn192+d/4Po2PgL45Tl55wgsLM6qGs750S0+JOM= =kxiF -----END PGP SIGNATURE----- --0CCZsdKjKFoETjui--