This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] gdbserver/ax.c: resolve compiler warning
- From: Dilyan Palauzov <dilyan dot palauzov at aegee dot org>
- To: gdb-patches at sourceware dot org
- Date: Tue, 14 Jul 2015 19:25:48 +0200
- Subject: [PATCH] gdbserver/ax.c: resolve compiler warning
- Authentication-results: sourceware.org; auth=none
- Authentication-results: aegeeserv.aegee.org; auth=pass (PLAIN) smtp.auth=didopalauzov
- Authentication-results: mail.aegee.org; dkim=none
- Dkim-filter: OpenDKIM Filter v2.10.3 smtp.aegee.org t6EHPQUv009133
gdbserver/ax.c defines unconditionally "static const unsigned char
gdb_agent_op_sizes[]", but uses it, only when "#ifndef
IN_PROCESS_AGENT". This leads to compiler warning of type "unused".
This patch moves the above definition within "#ifndef IN_PROCESS_AGENT".
diff --git a/gdb/gdbserver/ax.c b/gdb/gdbserver/ax.c
index c5b65fa..193d37d 100644
--- a/gdb/gdbserver/ax.c
+++ b/gdb/gdbserver/ax.c
@@ -69,14 +69,6 @@ static const char *gdb_agent_op_names
[gdb_agent_op_last] =
#undef DEFOP
};
-static const unsigned char gdb_agent_op_sizes [gdb_agent_op_last] =
- {
- 0
-#define DEFOP(NAME, SIZE, DATA_SIZE, CONSUMED, PRODUCED, VALUE) , SIZE
-#include "ax.def"
-#undef DEFOP
- };
-
/* A wrapper for gdb_agent_op_names that does some bounds-checking. */
static const char *
@@ -89,6 +81,14 @@ gdb_agent_op_name (int op)
#ifndef IN_PROCESS_AGENT
+static const unsigned char gdb_agent_op_sizes [gdb_agent_op_last] =
+ {
+ 0
+#define DEFOP(NAME, SIZE, DATA_SIZE, CONSUMED, PRODUCED, VALUE) , SIZE
+#include "ax.def"
+#undef DEFOP
+ };
+
/* The packet form of an agent expression consists of an 'X', number
of bytes in expression, a comma, and then the bytes. */