8000 Silence compiler warnings from some older compilers. · postgres/postgres@37290f7 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 37290f7

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 b526519 commit 37290f7

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

contrib/amcheck/verify_nbtree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ bt_index_check_internal(Oid indrelid, bool parentcheck, bool heapallindexed)
242242
else
243243
{
244244
heaprel = NULL;
245-
/* for "gcc -Og" https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78394 */
245+
/* Set these just to suppress "uninitialized variable" warnings */
246246
save_userid = InvalidOid;
247247
save_sec_context = -1;
248248
save_nestlevel = -1;

src/backend/access/brin/brin.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,13 @@ brin_summarize_range(PG_FUNCTION_ARGS)
916916
save_nestlevel = NewGUCNestLevel();
917917
}
918918
else
919+
{
919920
heapRel = NULL;
921+
/* Set these just to suppress "uninitialized variable" warnings */
922+
save_userid = InvalidOid;
923+
save_sec_context = -1;
924+
save_nestlevel = -1;
925+
}
920926

921927
indexRel = index_open(indexoid, ShareUpdateExclusiveLock);
922928

0 commit comments

Comments
 (0)
0