From 19fef7f2f63baab89d30e8bcc593ea8266544b7d Mon Sep 17 00:00:00 2001
From: Konstantin Shulgin <konstantin.shulgin@gmail.com>
Date: Fri, 20 Apr 2012 18:02:19 +0400
Subject: [PATCH] bug984669:

Warnings was removed. Minor coding-style cleanup.
---
 core/replication.m              | 9 +++++++--
 core/tarantool_lua.m            | 3 ++-
 mod/box/tree.m                  | 6 ++++--
 third_party/valgrind/valgrind.h | 2 +-
 4 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/core/replication.m b/core/replication.m
index 326762ccae..b40ee701ea 100644
--- a/core/replication.m
+++ b/core/replication.m
@@ -437,13 +437,18 @@ static void spawner_signal_handler(int signal)
 static void
 spawner_sigchld_handler(int signo __attribute__((unused)))
 {
+	static const char waitpid_failed[] = "spawner: waitpid() failed\n";
 	do {
 		int exit_status;
 		pid_t pid = waitpid(-1, &exit_status, WNOHANG);
 		switch (pid) {
 		case -1:
-			if (errno != ECHILD)
-				write(sayfd, "spawner: waitpid() failed\n", 26);
+			if (errno != ECHILD) {
+				int r = write(sayfd, waitpid_failed,
+					      sizeof(waitpid_failed) - 1);
+				(void) r; /* -Wunused-result warning suppression */
+			}
+			return;
 		case 0: /* no more changes in children status */
 			return;
 		default:
diff --git a/core/tarantool_lua.m b/core/tarantool_lua.m
index 3c3ae76b8a..3a5dcb5b22 100644
--- a/core/tarantool_lua.m
+++ b/core/tarantool_lua.m
@@ -978,7 +978,8 @@ is_string(const char *str)
 	if (! isdigit(*str))
 	    return true;
 	char *endptr;
-	(void) strtod(str, &endptr);
+	double r = strtod(str, &endptr);
+	(void) r;  /* -Wunused-result warning suppression */
 	return *endptr != '\0';
 }
 
diff --git a/mod/box/tree.m b/mod/box/tree.m
index 1b68f3854f..92096dda18 100644
--- a/mod/box/tree.m
+++ b/mod/box/tree.m
@@ -585,7 +585,8 @@ dense_node_compare(struct key_def *key_def, u32 first_field,
  * Compare a part for two dense keys with parts in linear order.
  */
 static int
-linear_node_compare(struct key_def *key_def, u32 first_field,
+linear_node_compare(struct key_def *key_def,
+		    u32 first_field  __attribute__((unused)),
 		    struct box_tuple *tuple_a, u32 offset_a,
 		    struct box_tuple *tuple_b, u32 offset_b)
 {
@@ -701,7 +702,8 @@ dense_key_node_compare(struct key_def *key_def,
 static int
 linear_key_node_compare(struct key_def *key_def,
 			const struct key_data *key_data,
-			u32 first_field, struct box_tuple *tuple, u32 offset)
+			u32 first_field __attribute__((unused)),
+			struct box_tuple *tuple, u32 offset)
 {
 	int part_count = key_def->part_count;
 	assert(first_field + part_count <= tuple->cardinality);
diff --git a/third_party/valgrind/valgrind.h b/third_party/valgrind/valgrind.h
index 221aa0153a..a217ecd874 100644
--- a/third_party/valgrind/valgrind.h
+++ b/third_party/valgrind/valgrind.h
@@ -4346,7 +4346,7 @@ typedef
 #define VALGRIND_DO_CLIENT_REQUEST_EXPR(                               \
         _zzq_default, _zzq_request,                                    \
         _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)         \
-   (_zzq_default)
+	(void)(_zzq_default)
 
 #else /*defined(NVALGRIND)*/
 
-- 
GitLab