GCC warning in back branches

Thomas Munro <thomas.munro@gmail.com>

From: Thomas Munro <thomas.munro@gmail.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2021-02-15T01:15:51Z
Lists: pgsql-hackers

Attachments

Hi,

guc.c: In function ‘RestoreGUCState’:
guc.c:9455:4: error: ‘varsourceline’ may be used uninitialized in this
function [-Werror=maybe-uninitialized]
 9455 |    set_config_sourcefile(varname, varsourcefile, varsourceline);
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I propose the attached.

Commits

  1. Fix compiler warning in back branches (9.6, 10).

  2. Fix assorted compiler warnings seen in the buildfarm.