From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32074 invoked by alias); 16 Apr 2009 17:30:39 -0000 Received: (qmail 32059 invoked by uid 22791); 16 Apr 2009 17:30:35 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 16 Apr 2009 17:30:31 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id B449C2BAC6A for ; Thu, 16 Apr 2009 13:30:29 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id uar2zUkXjjXK for ; Thu, 16 Apr 2009 13:30:29 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 7AC1A2BAC63 for ; Thu, 16 Apr 2009 13:30:29 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 8BB57F58C1; Thu, 16 Apr 2009 10:30:25 -0700 (PDT) Date: Thu, 16 Apr 2009 17:30:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Subject: [commit] Fix compilation warning in procfs.c on mips-irix Message-ID: <20090416173025.GO7557@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Fig2xvG2VGoz8o/s" Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) 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: 2009-04/txt/msg00370.txt.bz2 --Fig2xvG2VGoz8o/s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 721 While I was building GDB on mips-irix, I noticed a couple of warnings, so I decided to fix them. On mips-irix, the pr_vaddr field is a caddr, and apparently, CORE_ADDR is not the same size as this type. So we need to cast it to an integer type with the same size first, and then to CORE_ADDR. 2009-04-16 Joel Brobecker * procfs.c (solib_mappings_callback, find_memory_regions_callback): Fix a compilation warning on mips-irix due to casting from a pointer of different size. I actually meant to post this patch and wait for a few days before checking in, but I accidently did the checkin. I'm pretty sure it's OK, but let me know if not, and I'll revert. -- Joel --Fig2xvG2VGoz8o/s Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="procfs.diff" Content-length: 1023 commit b39e37470c731a5a201a3466ff01aad38b3d4f36 Author: Joel Brobecker Date: Wed Apr 8 15:02:40 2009 -0700 * procfs.c (solib_mappings_callback, find_memory_regions_callback): Fix a compilation warning on mips-irix due to casting from a pointer of different size. diff --git a/gdb/procfs.c b/gdb/procfs.c index adb44f4..36d0e47 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -5473,7 +5473,7 @@ int solib_mappings_callback (struct prmap *map, no file, so the ioctl may return failure, but that's not a problem. */ #endif - return (*func) (fd, (CORE_ADDR) map->pr_vaddr); + return (*func) (fd, (CORE_ADDR) (uintptr_t) map->pr_vaddr); } /* @@ -5524,7 +5524,7 @@ find_memory_regions_callback (struct prmap *map, void *), void *data) { - return (*func) ((CORE_ADDR) map->pr_vaddr, + return (*func) ((CORE_ADDR) (uintptr_t) map->pr_vaddr, map->pr_size, (map->pr_mflags & MA_READ) != 0, (map->pr_mflags & MA_WRITE) != 0, --Fig2xvG2VGoz8o/s--