From patchwork Tue Jul 14 17:25:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?0JTQuNC70Y/QvSDQn9Cw0LvQsNGD0LfQvtCy?= X-Patchwork-Id: 7673 Received: (qmail 32249 invoked by alias); 14 Jul 2015 17:25:36 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 32240 invoked by uid 89); 14 Jul 2015 17:25:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: scc-mailout-kit-01-aegee.scc.kit.edu Received: from scc-mailout-kit-01-aegee.scc.kit.edu (HELO scc-mailout-kit-01-aegee.scc.kit.edu) (129.13.231.90) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 14 Jul 2015 17:25:33 +0000 Received: from aegeepc1.aegee.uni-karlsruhe.de ([129.13.131.81] helo=smtp.aegee.org) by scc-mailout-kit-01.scc.kit.edu with esmtps (TLS1.2:RSA_CAMELLIA_256_CBC_SHA1:256) (envelope-from ) id 1ZF3xR-0001V6-MV for gdb-patches@sourceware.org; Tue, 14 Jul 2015 19:25:30 +0200 Authentication-Results: aegeeserv.aegee.org; auth=pass (PLAIN) smtp.auth=didopalauzov DKIM-Filter: OpenDKIM Filter v2.10.3 smtp.aegee.org t6EHPQUv009133 Authentication-Results: mail.aegee.org; dkim=none Received: from [192.168.178.22] (aftr-185-17-204-65.dynamic.mnet-online.de [185.17.204.65]) (authenticated bits=0) by smtp.aegee.org (8.15.1/8.15.1) with ESMTPSA id t6EHPQUv009133 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 14 Jul 2015 17:25:27 GMT Message-ID: <55A5461C.7090107@aegee.org> Date: Tue, 14 Jul 2015 19:25:48 +0200 From: Dilyan Palauzov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: [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". 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. */ 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. */