Re: back-port one-line gcc-10+ warning fix to REL_10_STABLE

Alvaro Herrera <alvherre@alvh.no-ip.org>

From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Anton Voloshin <a.voloshin@postgrespro.ru>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2021-06-07T15:14:25Z
Lists: pgsql-hackers
On 2021-Jun-07, Anton Voloshin wrote:

> Hello, hackers,
> 
> Currently, REL_10_STABLE can't be compiled with gcc-10 or 11, -Werror and
> "./configure" without arguments. E.g. gcc-11 gives an error:

Hi, thanks for the report.  I noticed that the commit that introduced
this (41306a511c01) was introduced in 9.5, so I was surprised that you
report it doesn't complain in 9.6.  Turns out that Peter E had fixed the
issue, but only in 9.5 and 9.6; I don't really understand why no fix was
applied to 10.  I forward-ported that commit to 10, which should also
fix the problem.  Branches 11 and up already have Tom Lane's fix.

-- 
Álvaro Herrera       Valdivia, Chile
"[PostgreSQL] is a great group; in my opinion it is THE best open source
development communities in existence anywhere."                (Lamar Owen)



Commits

  1. Fix compiler warning

  2. Silence assorted "variable may be used uninitialized" warnings.