pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Richard Guo <guofenglinux@gmail.com>
Cc: RekGRpth <rekgrpth@gmail.com>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: 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
Date: Thu, 7 Dec 2023 11:32:33 +0900
Message-ID: <ZXEuwRR0Sq012eiu@paquier.xyz> (raw)
In-Reply-To: <CAMbWs48z_7Vc8_Q93QEuUaB6n3-rJPO0f8KF=gbogzTmK4hvpA@mail.gmail.com>
References: <18230-c68eb05e05cb9177@postgresql.org>
	<da26cdf3558c605244838ca899c96c8874bbe92d.camel@cybertec.at>
	<CAPgh2mJJ7XrHTWSnYEb92R4PoknrqopOKDe6+795=v3q1aD6Eg@mail.gmail.com>
	<51a453dfe23d1b7f33c2d9b495a4c6eb972da61e.camel@cybertec.at>
	<CAPgh2mKi8t8T7Tsqx-EwSMYG_xYQQSY30qp18sH8dVySP4Fmdg@mail.gmail.com>
	<CAMbWs48z_7Vc8_Q93QEuUaB6n3-rJPO0f8KF=gbogzTmK4hvpA@mail.gmail.com>

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

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (11+ messages)  latest in thread

Message-ID: <ZXEuwRR0Sq012eiu@paquier.xyz>
Permalink:  ../ZXEuwRR0Sq012eiu@paquier.xyz/
Also on:    postgresql.org/message-id/ZXEuwRR0Sq012eiu@paquier.xyz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: michael@paquier.xyz, guofenglinux@gmail.com, rekgrpth@gmail.com, laurenz.albe@cybertec.at, 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
  In-Reply-To: <ZXEuwRR0Sq012eiu@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox