From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3343 invoked by alias); 29 Aug 2012 14:43:18 -0000 Received: (qmail 3332 invoked by uid 22791); 29 Aug 2012 14:43:17 -0000 X-SWARE-Spam-Status: No, hits=-4.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 29 Aug 2012 14:43:03 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1T6jTy-0001EL-OQ from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Wed, 29 Aug 2012 07:43:02 -0700 Received: from SVR-ORW-FEM-02.mgc.mentorg.com ([147.34.96.206]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 29 Aug 2012 07:43:02 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.1.289.1; Wed, 29 Aug 2012 07:43:01 -0700 Message-ID: <503E2A7A.2030709@codesourcery.com> Date: Wed, 29 Aug 2012 14:43:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: Hui Zhu CC: Subject: Re: [PATCH] target attributes [1/5] core and load from target function References: <503DCEC5.2010308@mentor.com> In-Reply-To: <503DCEC5.2010308@mentor.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-08/txt/msg00848.txt.bz2 On 08/29/2012 04:11 PM, Hui Zhu wrote: > +static void > +target_attribute_address_handler (struct gdb_xml_parser *parser, > + const struct gdb_xml_element *element, > + void *user_data, > + VEC(gdb_xml_value_s) *attributes) > +{ > + int i, len; > + struct gdb_xml_value *attrs = VEC_address (gdb_xml_value_s, attributes); > + struct target_attribute *ta = *(struct target_attribute **)user_data; > + CORE_ADDR start, end; > + struct target_attribute_address *ta_addr; I happen to see some compilation warnings on my new Fedora 16 box, while these warnings don't appear on my Ubuntu box. ... -Werror -c -o target-memory.o -MT target-memory.o -MMD -MP -MF .deps/target-memory.Tpo ../../../git/gdb/target-memory.c ../../../git/gdb/target-attributes.c: In function ‘target_attribute_address_handler’: ../../../git/gdb/target-attributes.c:487:16: error: ‘end’ may be used uninitialized in this function [-Werror=uninitialized] ../../../git/gdb/target-attributes.c:486:18: error: ‘start’ may be used uninitialized in this function [-Werror=uninitialized] ../../../git/gdb/target-attributes.c: In function ‘target_attribute_attr_handler’: ../../../git/gdb/target-attributes.c:376:12: error: ‘type’ may be used uninitialized in this function [-Werror=uninitialized] ../../../git/gdb/target-attributes.c: In function ‘target_attribute_type’: ../../../git/gdb/target-attributes.c:632:3: error: ‘ret’ may be used uninitialized in this function [-Werror=uninitialized] cc1: all warnings being treated as errors make: *** [target-attributes.o] Error 1 The gcc I am using is 4.6.3 $ gcc --version gcc (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2) We have to get these warnings fixed. > + > + len = VEC_length (gdb_xml_value_s, attributes); > + for (i = 0; i < len; i++) > + { > + if (strcmp (attrs[i].name, "start") == 0) > + start = * (ULONGEST *) attrs[i].value; > + else if (strcmp (attrs[i].name, "end") == 0) > + end = * (ULONGEST *) attrs[i].value; > + else > + gdb_xml_error (parser, _("Unknown attribute name '%s'."), > + attrs[i].name); > + } > + > + ta_addr = xmalloc (sizeof (struct target_attribute_address)); > + ta_addr->start = start; > + ta_addr->end = end; > + > + ta_addr->prev = ta->addresses; > + ta->addresses = ta_addr; > +} -- Yao