Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: [commit] Fix compilation warning in procfs.c on mips-irix
Date: Thu, 16 Apr 2009 17:30:00 -0000	[thread overview]
Message-ID: <20090416173025.GO7557@adacore.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 721 bytes --]

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  <brobecker@adacore.com>

        * 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

[-- Attachment #2: procfs.diff --]
[-- Type: text/x-diff, Size: 1023 bytes --]

commit b39e37470c731a5a201a3466ff01aad38b3d4f36
Author: Joel Brobecker <brobecker@adacore.com>
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,

             reply	other threads:[~2009-04-16 17:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-16 17:30 Joel Brobecker [this message]
2009-04-16 18:24 ` Pedro Alves
2009-04-16 18:45   ` Joel Brobecker
2009-04-16 19:52     ` Daniel Jacobowitz
2009-04-17 13:27       ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090416173025.GO7557@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox