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.
From d0ce66b0a24c99ed94f8caac32084b44990863ce Mon Sep 17 00:00:00 2001
From: Thomas Munro <[email protected]>
Date: Mon, 15 Feb 2021 14:04:58 +1300
Subject: [PATCH 1/2] Fix compiler warning in back branches.
Back-patch a tiny bit of commit fbb2e9a0 into 9.6 and 10, to silence an
uninitialized variable warning from GCC 10.2.
---
src/backend/utils/misc/guc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 9f47bd0aea..9e26cbd18e 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -9437,6 +9437,8 @@ RestoreGUCState(void *gucstate)
if (varsourcefile[0])
read_gucstate_binary(&srcptr, srcend,
&varsourceline, sizeof(varsourceline));
+ else
+ varsourceline = 0;
read_gucstate_binary(&srcptr, srcend,
&varsource, sizeof(varsource));
read_gucstate_binary(&srcptr, srcend,
--
2.30.0