This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] gdbserver/ax.c: resolve compiler warning


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.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]