]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix compiler warning in back branches (9.6, 10).
authorThomas Munro <tmunro@postgresql.org>
Tue, 16 Feb 2021 00:10:37 +0000 (13:10 +1300)
committerThomas Munro <tmunro@postgresql.org>
Tue, 16 Feb 2021 00:16:09 +0000 (13:16 +1300)
Back-patch a tiny bit of commit fbb2e9a0 into 9.6 and 10, to silence an
uninitialized variable warning from GCC 10.2.  Seen on buildfarm member
handfish, and my own development workflow where I like to use -Werror.

Discussion: https://postgr.es/m/CA%2BhUKGJRcwvK86Uf5t-FrTekZjqHtpv3u%3D3MuBg8Zw8R933Mqg%40mail.gmail.com

src/backend/utils/misc/guc.c

index 9f47bd0aea9ea21111da93db81a696c87ab01386..9e26cbd18e38728e0b6af43d66c956acd3ce0c58 100644 (file)
@@ -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,