From patchwork Thu Sep 22 10:40:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Kolesov X-Patchwork-Id: 15894 Received: (qmail 84215 invoked by alias); 22 Sep 2016 10:40:26 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 84063 invoked by uid 89); 22 Sep 2016 10:40:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.5 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Printing X-HELO: smtprelay.synopsys.com Received: from smtprelay.synopsys.com (HELO smtprelay.synopsys.com) (198.182.47.9) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 22 Sep 2016 10:40:15 +0000 Received: from us02secmta2.synopsys.com (us02secmta2.synopsys.com [10.12.235.98]) by smtprelay.synopsys.com (Postfix) with ESMTP id A35B124E1FF8 for ; Thu, 22 Sep 2016 03:40:13 -0700 (PDT) Received: from us02secmta2.internal.synopsys.com (us02secmta2.internal.synopsys.com [127.0.0.1]) by us02secmta2.internal.synopsys.com (Service) with ESMTP id 9609655F13 for ; Thu, 22 Sep 2016 03:40:13 -0700 (PDT) Received: from mailhost.synopsys.com (mailhost3.synopsys.com [10.12.238.238]) by us02secmta2.internal.synopsys.com (Service) with ESMTP id 7945155F02 for ; Thu, 22 Sep 2016 03:40:13 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 687D51AF; Thu, 22 Sep 2016 03:40:13 -0700 (PDT) Received: from akolesov-lab.internal.synopsys.com (akolesov-lab.internal.synopsys.com [10.121.8.134]) by mailhost.synopsys.com (Postfix) with ESMTP id 5BB9019F; Thu, 22 Sep 2016 03:40:12 -0700 (PDT) From: Anton Kolesov To: gdb-patches@sourceware.org Cc: Anton Kolesov , Francois Bedard Subject: [PATCH] arc: Fix ARI warning for printf(%p) Date: Thu, 22 Sep 2016 13:40:08 +0300 Message-Id: <1474540808-24812-1-git-send-email-Anton.Kolesov@synopsys.com> In-Reply-To: <20160922015601.GA123362@sourceware.org> References: <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) {