From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25653 invoked by alias); 11 Apr 2013 22:59:43 -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 25644 invoked by uid 89); 11 Apr 2013 22:59:43 -0000 X-Spam-SWARE-Status: No, score=-8.9 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_EG autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 11 Apr 2013 22:59:43 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3BMxgfi001011 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 11 Apr 2013 18:59:42 -0400 Received: from brno.lan (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r3BMxdBR016392 for ; Thu, 11 Apr 2013 18:59:40 -0400 Subject: [PATCH 06/26] mips-tdep.c: Wrong signness for local holding PC register. To: gdb-patches@sourceware.org From: Pedro Alves Date: Thu, 11 Apr 2013 23:01:00 -0000 Message-ID: <20130411225939.16791.94190.stgit@brno.lan> In-Reply-To: <20130411225847.16791.29283.stgit@brno.lan> References: <20130411225847.16791.29283.stgit@brno.lan> User-Agent: StGit/0.16 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-SW-Source: 2013-04/txt/msg00346.txt.bz2 Addresses on MIPS are signed, and we're indeed using regcache_cooked_read_signed to read the PC, but, we're passing it the address of an unsigned variable, which triggers a -Wpointer-sign warning. I've chosen to change the variable's type. I believe this will end up being the same (though I can't test it). gdb/ 2013-04-11 Pedro Alves * mips-tdep.c (mips_read_pc): Change local 'pc' type to LONGEST. --- gdb/mips-tdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 8e5d5d2..245ffd6 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -1245,7 +1245,7 @@ static CORE_ADDR mips_read_pc (struct regcache *regcache) { int regnum = gdbarch_pc_regnum (get_regcache_arch (regcache)); - ULONGEST pc; + LONGEST pc; regcache_cooked_read_signed (regcache, regnum, &pc); if (is_compact_addr (pc))