Skip to content

Commit 0fbcb9d

Browse files
Fix unused-but-set-variable compiler warning in reorderbuffer.c.
On v13, this variable is only used for an assertion, so adding PG_USED_FOR_ASSERTS_ONLY is sufficient to suppress this warning on builds with assertions disabled. Older versions are unsupported, and newer versions use the variable for more than the assertion, so this patch only needs to be applied to REL_13_STABLE. Reviewed-by: Tom Lane Discussion: https://postgr.es/m/Z1dCFnzrP24O8WNR%40nathan
1 parent a51ec08 commit 0fbcb9d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/replication/logical/reorderbuffer.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2468,7 +2468,7 @@ ReorderBufferSerializeTXN(ReorderBuffer *rb, ReorderBufferTXN *txn)
24682468
dlist_mutable_iter change_i;
24692469
int fd = -1;
24702470
XLogSegNo curOpenSegNo = 0;
2471-
Size spilled = 0;
2471+
Size spilled PG_USED_FOR_ASSERTS_ONLY = 0;
24722472

24732473
elog(DEBUG2, "spill %u changes in XID %u to disk",
24742474
(uint32) txn->nentries_mem, txn->xid);

0 commit comments

Comments
 (0)