[Tarantool-patches] [PATCH v1 1/4] build: fix Werror warning in src/box/txn.c

Alexander V. Tikhonov avtikhon at tarantool.org
Wed Oct 14 19:35:43 MSK 2020


Found on GCC 4.8.5 on CentOS 7 issue:

  build/usr/src/debug/tarantool-2.6.0.144/src/box/txn.c:944:30: error: ‘limbo_entry’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
     if (txn_limbo_wait_complete(&txn_limbo, limbo_entry) < 0)

Set limbo_entry variable to NULL on initialization.

Needed for #4941
---

Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-4941-gcc-old
Issue: https://github.com/tarantool/tarantool/issues/4941

 src/box/txn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/box/txn.c b/src/box/txn.c
index 4f5484ec5..eb725aaa9 100644
--- a/src/box/txn.c
+++ b/src/box/txn.c
@@ -886,7 +886,7 @@ int
 txn_commit(struct txn *txn)
 {
 	struct journal_entry *req;
-	struct txn_limbo_entry *limbo_entry;
+	struct txn_limbo_entry *limbo_entry = NULL;
 
 	txn->fiber = fiber();
 
-- 
2.25.1



More information about the Tarantool-patches mailing list