Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Anton Kolesov <Anton.Kolesov@synopsys.com>
To: gdb-patches@sourceware.org
Cc: Anton Kolesov <Anton.Kolesov@synopsys.com>,
	Francois Bedard <Francois.Bedard@synopsys.com>
Subject: [PATCH] arc: Fix ARI warning for printf(%p)
Date: Thu, 22 Sep 2016 11:12:00 -0000	[thread overview]
Message-ID: <1474540808-24812-1-git-send-email-Anton.Kolesov@synopsys.com> (raw)
In-Reply-To: <20160922015601.GA123362@sourceware.org>

This particular warning is printed only when option -Wari is passed to
contrib/ari/gdb_ari.sh , so it slipped under my radar.

Ok to commit?

--

Replace printf ("%p") with printf ("%s", host_address_to_string ()). Printing
host address might make sense here because printed pointers can be null and
this would affect how arc_return_value behaves.
---
 gdb/arc-tdep.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c
index 6048ad6..7bb93ad 100644
--- a/gdb/arc-tdep.c
+++ b/gdb/arc-tdep.c
@@ -574,8 +574,9 @@ arc_return_value (struct gdbarch *gdbarch, struct value *function,
 			  || TYPE_LENGTH (valtype) > 2 * ARC_REGISTER_SIZE);
 
   if (arc_debug)
-    debug_printf ("arc: return_value (readbuf = %p, writebuf = %p)\n",
-		  readbuf, writebuf);
+    debug_printf ("arc: return_value (readbuf = %s, writebuf = %s)\n",
+		  host_address_to_string (readbuf),
+		  host_address_to_string (writebuf));
 
   if (writebuf != NULL)
     {
-- 
2.8.1


  reply	other threads:[~2016-09-22 10:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-22  9:05 New ARI warning Thu Sep 22 01:56:01 UTC 2016 GDB Administrator
2016-09-22 11:12 ` Anton Kolesov [this message]
2016-09-22 11:20   ` [PATCH] arc: Fix ARI warning for printf(%p) 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=1474540808-24812-1-git-send-email-Anton.Kolesov@synopsys.com \
    --to=anton.kolesov@synopsys.com \
    --cc=Francois.Bedard@synopsys.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