From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3598 invoked by alias); 12 Apr 2013 02:32:20 -0000 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 Received: (qmail 3548 invoked by uid 89); 12 Apr 2013 02:32:19 -0000 X-Spam-SWARE-Status: No, score=-4.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL autolearn=ham version=3.3.1 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 12 Apr 2013 02:32:18 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1UQTmh-0005gO-Aw from Yao_Qi@mentor.com ; Thu, 11 Apr 2013 19:32:15 -0700 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 11 Apr 2013 19:32:14 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.1.289.1; Thu, 11 Apr 2013 19:32:13 -0700 Message-ID: <5167722D.301@codesourcery.com> Date: Fri, 12 Apr 2013 12:34:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Pedro Alves CC: Subject: Re: [PATCH 02/26] -Wpointer-sign: gdb_byte -> char. References: <20130411225847.16791.29283.stgit@brno.lan> <20130411225907.16791.47628.stgit@brno.lan> In-Reply-To: <20130411225907.16791.47628.stgit@brno.lan> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-SW-Source: 2013-04/txt/msg00369.txt.bz2 On 04/12/2013 06:59 AM, Pedro Alves wrote: > diff --git a/gdb/i386-cygwin-tdep.c b/gdb/i386-cygwin-tdep.c > index cee2adf..26ffbaa 100644 > --- a/gdb/i386-cygwin-tdep.c > +++ b/gdb/i386-cygwin-tdep.c > @@ -125,11 +125,11 @@ core_process_module_section (bfd *abfd, asection *sect, void *obj) > struct cpms_data *data = obj; > enum bfd_endian byte_order = gdbarch_byte_order (data->gdbarch); > > - char *module_name; > + gdb_byte *module_name; > size_t module_name_size; > CORE_ADDR base_addr; > > - char *buf = NULL; > + gdb_byte *buf = NULL; > > if (strncmp (sect->name, ".module", 7) != 0) > return; > @@ -160,7 +160,7 @@ core_process_module_section (bfd *abfd, asection *sect, void *obj) > > /* The first module is the .exe itself. */ > if (data->module_count != 0) > - windows_xfer_shared_library (module_name, base_addr, > + windows_xfer_shared_library ((char *) module_name, base_addr, > data->gdbarch, data->obstack); > data->module_count++; > It would be nice to keep 'module_name' of type 'char *', because it is a string. > diff --git a/gdb/solib-dsbt.c b/gdb/solib-dsbt.c > index e2822c1..86ce062 100644 > --- a/gdb/solib-dsbt.c > +++ b/gdb/solib-dsbt.c > @@ -840,7 +840,7 @@ enable_break2 (void) > if (interp_sect) > { > unsigned int interp_sect_size; > - gdb_byte *buf; > + char *buf; > bfd *tmp_bfd = NULL; > CORE_ADDR addr; > gdb_byte addr_buf[TIC6X_PTR_SIZE]; > @@ -852,7 +852,7 @@ enable_break2 (void) > interp_sect_size = bfd_section_size (exec_bfd, interp_sect); > buf = alloca (interp_sect_size); > bfd_get_section_contents (exec_bfd, interp_sect, > - buf, 0, interp_sect_size); > + (bfd_byte *) buf, 0, interp_sect_size); The declaration of bfd_get_section_contents is, bfd_boolean bfd_get_section_contents (bfd *abfd, asection *section, void *location, file_ptr offset, bfd_size_type count); the parameter 'location' 's type is 'void *', do we really need to cast 'buf' to 'bfd_byte *'? > > /* Now we need to figure out where the dynamic linker was > loaded so that we can load its symbols and place a breakpoint > diff --git a/gdb/solib-frv.c b/gdb/solib-frv.c > index 52588bc..1765969 100644 > --- a/gdb/solib-frv.c > +++ b/gdb/solib-frv.c > @@ -535,7 +535,7 @@ enable_break2 (void) > if (interp_sect) > { > unsigned int interp_sect_size; > - gdb_byte *buf; > + char *buf; > bfd *tmp_bfd = NULL; > int status; > CORE_ADDR addr, interp_loadmap_addr; > @@ -548,7 +548,7 @@ enable_break2 (void) > interp_sect_size = bfd_section_size (exec_bfd, interp_sect); > buf = alloca (interp_sect_size); > bfd_get_section_contents (exec_bfd, interp_sect, > - buf, 0, interp_sect_size); > + (gdb_byte *) buf, 0, interp_sect_size); Likewise. -- Yao (齐尧)