Skip to content

Commit dd1c8dd

Browse files
committed
Silence compiler warnings from some older compilers.
Since a117ceb, some older gcc versions issue "variable may be used uninitialized in this function" complaints for brin_summarize_range. Silence that using the same coding pattern as in bt_index_check_internal; arguably, a117ceb had too narrow a view of which compilers might give trouble. Nathan Bossart and Tom Lane. Back-patch as the previous commit was. Discussion: https://postgr.es/m/20220601163537.GA2331988@nathanxps13
1 parent eb39610 commit dd1c8dd

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

contrib/amcheck/verify_nbtree.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ bt_index_check_internal(Oid indrelid, bool parentcheck, bool heapallindexed,
284284
else
285285
{
286286
heaprel = NULL;
287-
/* for "gcc -Og" https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78394 */
287+
/* Set these just to suppress "uninitialized variable" warnings */
288288
save_userid = InvalidOid;
289289
save_sec_context = -1;
290290
save_nestlevel = -1;

src/backend/access/brin/brin.c

+6
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,13 @@ brin_summarize_range(PG_FUNCTION_ARGS)
10511051
save_nestlevel = NewGUCNestLevel();
10521052
}
10531053
else
1054+
{
10541055
heapRel = NULL;
1056+
/* Set these just to suppress "uninitialized variable" warnings */
1057+
save_userid = InvalidOid;
1058+
save_sec_context = -1;
1059+
save_nestlevel = -1;
1060+
}
10551061

10561062
indexRel = index_open(indexoid, ShareUpdateExclusiveLock);
10571063

0 commit comments

Comments
 (0)