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

From: Alexander Lakhin <exclusion(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Avoid unused value (src/fe_utils/print.c)
Date: 2023-06-04 04:00:00
Message-ID: b5aba8e3-911c-6fa0-eb13-bb2a6f2a0537@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Julien Rouhaud 2023-06-04 06:02:49 Re: Improve join_search_one_level readibilty (one line change)
Previous Message Kirk Wolak 2023-06-04 03:10:19 Re: [BUG] pg_dump does not properly deal with BEGIN ATOMIC function