From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18702 invoked by alias); 7 Jan 2014 13:57:08 -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 18690 invoked by uid 89); 7 Jan 2014 13:57:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 07 Jan 2014 13:57:06 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1W0X9T-0003bw-B7 from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Tue, 07 Jan 2014 05:57:03 -0800 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 7 Jan 2014 05:57:03 -0800 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.2.247.3; Tue, 7 Jan 2014 05:57:02 -0800 From: Yao Qi To: Subject: [PATCH] Fix pointer assignment with different signedness Date: Tue, 07 Jan 2014 13:57:00 -0000 Message-ID: <1389102920-16266-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2014-01/txt/msg00141.txt.bz2 This patch fixes these build errors below: ../../binutils-gdb/gdb/spu-linux-nat.c: In function ‘spu_symbol_file_add_from_memory’: ../../binutils-gdb/gdb/spu-linux-nat.c:368:3: error: pointer targets in passing argument 2 of ‘spu_proc_xfer_spu’ differ in signedness [-Werror=pointer-sign] ../../binutils-gdb/gdb/spu-linux-nat.c:232:1: note: expected ‘gdb_byte *’ but argument is of type ‘char *’ ../../binutils-gdb/gdb/spu-linux-nat.c: In function ‘spu_xfer_partial’: ../../binutils-gdb/gdb/spu-linux-nat.c:598:7: error: pointer targets in passing argument 1 of ‘strtoulst’ differ in signedness [-Werror=pointer-sign] In file included from ../../binutils-gdb/gdb/defs.h:769:0, from ../../binutils-gdb/gdb/spu-linux-nat.c:21: ../../binutils-gdb/gdb/utils.h:43:15: note: expected ‘const char *’ but argument is of type ‘gdb_byte *’ Is it OK? gdb: 2014-01-07 Yao Qi * spu-linux-nat.c (spu_symbol_file_add_from_memory): Change type of 'id' to gdb_byte. Cast 'id' to 'const char *'. (spu_xfer_partial): Cast 'buf' to 'const char *'. --- gdb/spu-linux-nat.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gdb/spu-linux-nat.c b/gdb/spu-linux-nat.c index cfd5fd9..4c62ec7 100644 --- a/gdb/spu-linux-nat.c +++ b/gdb/spu-linux-nat.c @@ -359,7 +359,7 @@ spu_symbol_file_add_from_memory (int inferior_fd) ULONGEST addr; struct bfd *nbfd; - char id[128]; + gdb_byte id[128]; char annex[32]; int len; @@ -369,7 +369,7 @@ spu_symbol_file_add_from_memory (int inferior_fd) if (len <= 0 || len >= sizeof id) return; id[len] = 0; - addr = strtoulst (id, NULL, 16); + addr = strtoulst ((const char *) id, NULL, 16); if (!addr) return; @@ -596,7 +596,7 @@ spu_xfer_partial (struct target_ops *ops, if (spu_proc_xfer_spu (lslr_annex, buf, NULL, 0, sizeof buf) <= 0) return ret; - lslr = strtoulst (buf, NULL, 16); + lslr = strtoulst ((const char *) buf, NULL, 16); return spu_proc_xfer_spu (mem_annex, readbuf, writebuf, offset & lslr, len); } -- 1.7.7.6