From 24b70de108673da4ebc3e8124d64b874ee6d6d8a Mon Sep 17 00:00:00 2001
From: Roman Tsisyk <roman@tarantool.org>
Date: Tue, 22 Aug 2017 19:47:14 +0300
Subject: [PATCH] Fix compilation warnings

---
 src/box/replication.cc        | 2 ++
 src/box/space.cc              | 2 +-
 src/box/vy_tx.c               | 2 +-
 test/unit/vy_point_iterator.c | 2 +-
 4 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/box/replication.cc b/src/box/replication.cc
index 30aa6fad3d..fea8e825ad 100644
--- a/src/box/replication.cc
+++ b/src/box/replication.cc
@@ -76,6 +76,7 @@ replication_init(void)
 {
 	mempool_create(&replica_pool, &cord()->slabc,
 		       sizeof(struct replica));
+	memset(&replicaset, 0, sizeof(replicaset));
 	replicaset_new(&replicaset);
 	vclock_create(&replicaset_vclock);
 }
@@ -183,6 +184,7 @@ void
 replicaset_update(struct applier **appliers, int count)
 {
 	replicaset_t uniq;
+	memset(&uniq, 0, sizeof(uniq));
 	replicaset_new(&uniq);
 	struct replica *replica, *next;
 
diff --git a/src/box/space.cc b/src/box/space.cc
index 88ca232bfd..e89afb3279 100644
--- a/src/box/space.cc
+++ b/src/box/space.cc
@@ -83,7 +83,7 @@ space_new(struct space_def *def, struct rlist *key_list)
 	uint32_t index_id_max = 0;
 	uint32_t index_count = 0;
 	struct index_def *index_def;
-	struct index_def *pk = rlist_empty(key_list) ? NULL :
+	MAYBE_UNUSED struct index_def *pk = rlist_empty(key_list) ? NULL :
 		rlist_first_entry(key_list, struct index_def, link);
 	def = space_def_dup(def);
 	rlist_foreach_entry(index_def, key_list, link) {
diff --git a/src/box/vy_tx.c b/src/box/vy_tx.c
index 68094d7bb5..1a41e54620 100644
--- a/src/box/vy_tx.c
+++ b/src/box/vy_tx.c
@@ -690,7 +690,7 @@ vy_tx_track(struct vy_tx *tx, struct vy_index *index,
 	    struct tuple *key, bool is_gap)
 {
 	struct txv *v;
-	uint32_t part_count = tuple_field_count(key);
+	MAYBE_UNUSED uint32_t part_count = tuple_field_count(key);
 
 	/* We do not support tracking range requests. */
 	assert(part_count >= index->cmp_def->part_count);
diff --git a/test/unit/vy_point_iterator.c b/test/unit/vy_point_iterator.c
index b5b8d962e0..d9c763018e 100644
--- a/test/unit/vy_point_iterator.c
+++ b/test/unit/vy_point_iterator.c
@@ -268,7 +268,7 @@ test_basic()
 					continue;
 				}
 			}
-			uint32_t got;
+			uint32_t got = 0;
 			tuple_field_u32(res, 1, &got);
 			if (got != expect && expect_lsn != vy_stmt_lsn(res))
 				results_ok = false;
-- 
GitLab