Re: Avoid unused value (src/fe_utils/print.c) - Mailing list pgsql-hackers

From Alexander Lakhin
Subject Re: Avoid unused value (src/fe_utils/print.c)
Date
Msg-id b5aba8e3-911c-6fa0-eb13-bb2a6f2a0537@gmail.com
Whole thread Raw
In response to Re: Avoid unused value (src/fe_utils/print.c)  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Avoid unused value (src/fe_utils/print.c)
Re: Avoid unused value (src/fe_utils/print.c)
List pgsql-hackers
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 code changed a bit easier to understand I
> guess, so that would be a case-by-case analysis.  Saying that, the
> proposed patch seems right while it makes slightly easier to
> understand the footer print part.

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 after the loop "print cells" and the loop
"for (footers)" is executed.

Best regards,
Alexander



pgsql-hackers by date:

Previous
From: Kirk Wolak
Date:
Subject: Re: [BUG] pg_dump does not properly deal with BEGIN ATOMIC function
Next
From: Julien Rouhaud
Date:
Subject: Re: Improve join_search_one_level readibilty (one line change)