Re: Avoid unused value (src/fe_utils/print.c)

2023-07-28 Thread Karina Litskevich
On Tue, Jul 25, 2023 at 1:04 AM Ranier Vilela wrote: > Checked today, Coverity does not complain about need_recordsep. > Great! Thanks. So v2 patch makes Coverity happy, and as for me doesn't make the code less readable. Does anyone have any objections? Best regards, Karina Litskevich Postgres

Re: Avoid unused value (src/fe_utils/print.c)

2023-07-24 Thread Ranier Vilela
Em sex., 21 de jul. de 2023 às 09:13, Karina Litskevich < litskevichkar...@gmail.com> escreveu: > > > On Wed, Jul 12, 2023 at 1:46 AM Ranier Vilela wrote: > >> As there is consensus to keep the no-op assignment, >> I will go ahead and reject the patch. >> > > In your patch you suggest removing t

Re: Avoid unused value (src/fe_utils/print.c)

2023-07-21 Thread Karina Litskevich
On Wed, Jul 12, 2023 at 1:46 AM Ranier Vilela wrote: > As there is consensus to keep the no-op assignment, > I will go ahead and reject the patch. > In your patch you suggest removing two assignments, and we only have consensus to keep one of them. The other one is an obvious no-op. I attached

Re: Avoid unused value (src/fe_utils/print.c)

2023-07-11 Thread Ranier Vilela
Em ter., 11 de jul. de 2023 às 19:34, Marko Tiikkaja escreveu: > On Thu, Jul 6, 2023 at 5:37 PM Karina Litskevich > wrote: > > My point is, technically right now you won't see any difference in output > > if you remove the line. Because if we get to that line the need_recordsep > > is already tr

Re: Avoid unused value (src/fe_utils/print.c)

2023-07-11 Thread Marko Tiikkaja
On Thu, Jul 6, 2023 at 5:37 PM Karina Litskevich wrote: > My point is, technically right now you won't see any difference in output > if you remove the line. Because if we get to that line the need_recordsep > is already true. However, understanding why it is true is complicated. That's > why if y

Re: Avoid unused value (src/fe_utils/print.c)

2023-07-06 Thread Karina Litskevich
> > > >> But >> it's not obvious, so I also have doubts about removing this line. If >> someday >> print options are changed, for example to support printing footers and not >> printing headers, or anything else changes in this function, the output >> might >> be unexpected with this line removed.

Re: Avoid unused value (src/fe_utils/print.c)

2023-06-30 Thread Ranier Vilela
Em sex., 30 de jun. de 2023 às 13:00, Alexander Lakhin escreveu: > Hello Karina, > > 30.06.2023 17:25, Karina Litskevich wrote: > > Hi, > > > > Alexander wrote: > > > >> It also aligns the code with print_unaligned_vertical(), but I can't > see why > >> need_recordsep = true; > >> is a no-op here

Re: Avoid unused value (src/fe_utils/print.c)

2023-06-30 Thread Ranier Vilela
Em sex., 30 de jun. de 2023 às 11:26, Karina Litskevich < litskevichkar...@gmail.com> escreveu: > Hi, > > Alexander wrote: > > > It also aligns the code with print_unaligned_vertical(), but I can't see > why > > need_recordsep = true; > > is a no-op here (scan-build dislikes only need_recordsep =

Re: Avoid unused value (src/fe_utils/print.c)

2023-06-30 Thread Alexander Lakhin
Hello Karina, 30.06.2023 17:25, Karina Litskevich wrote: Hi, Alexander wrote: It also aligns the code with print_unaligned_vertical(), but I can't see why need_recordsep = true; is a no-op here (scan-build dislikes only need_recordsep = false;). I suspect that removing that line will change t

Re: Avoid unused value (src/fe_utils/print.c)

2023-06-30 Thread Karina Litskevich
Hi, Alexander wrote: > It also aligns the code with print_unaligned_vertical(), but I can't see why > need_recordsep = true; > is a no-op here (scan-build dislikes only need_recordsep = false;). > I suspect that removing that line will change the behaviour in cases when > need_recordsep = false a

Re: Avoid unused value (src/fe_utils/print.c)

2023-06-04 Thread Ranier Vilela
Em dom., 4 de jun. de 2023 às 01:00, Alexander Lakhin escreveu: > Hi Michael, > > 04.06.2023 01:42, Michael Paquier wrote: > > On Sat, Jun 03, 2023 at 03:00:01PM +0300, Alexander Lakhin wrote: > >> Clang' scan-build detects 58 errors "Dead assignment", including that > one. > >> Maybe it would be

Re: Avoid unused value (src/fe_utils/print.c)

2023-06-03 Thread Alexander Lakhin
Hi Michael, 04.06.2023 01:42, Michael Paquier wrote: On Sat, Jun 03, 2023 at 03:00:01PM +0300, Alexander Lakhin wrote: Clang' scan-build detects 58 errors "Dead assignment", including that one. Maybe it would be more sensible to eliminate all errors of this class? Depends on if this makes any

Re: Avoid unused value (src/fe_utils/print.c)

2023-06-03 Thread Michael Paquier
On Sat, Jun 03, 2023 at 03:00:01PM +0300, Alexander Lakhin wrote: > Clang' scan-build detects 58 errors "Dead assignment", including that one. > Maybe it would be more sensible to eliminate all errors of this class? Depends on if this makes any code changed a bit easier to understand I guess, so t

Re: Avoid unused value (src/fe_utils/print.c)

2023-06-03 Thread Ranier Vilela
Em sáb., 3 de jun. de 2023 às 09:00, Alexander Lakhin escreveu: > Hello Ranier, > > 03.06.2023 13:14, Ranier Vilela wrote: > > Hi, > > > > This is for Postgres 17 (head). > > > > Per Coverity. > > At function print_unaligned_text, variable "need_recordsep", is > > unnecessarily set to true and fa

Re: Avoid unused value (src/fe_utils/print.c)

2023-06-03 Thread Alexander Lakhin
Hello Ranier, 03.06.2023 13:14, Ranier Vilela wrote: Hi, This is for Postgres 17 (head). Per Coverity. At function print_unaligned_text, variable "need_recordsep", is unnecessarily set to true and false. Clang' scan-build detects 58 errors "Dead assignment", including that one. Maybe it woul

Avoid unused value (src/fe_utils/print.c)

2023-06-03 Thread Ranier Vilela
Hi, This is for Postgres 17 (head). Per Coverity. At function print_unaligned_text, variable "need_recordsep", is unnecessarily set to true and false. Attached a trivial fix patch. regards, Ranier Vilela avoid-unused-value-print.patch Description: Binary data