From patchwork Sun Mar 8 07:24:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 5522 Received: (qmail 13777 invoked by alias); 8 Mar 2015 07:24:58 -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 13765 invoked by uid 89); 8 Mar 2015 07:24:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: smtp.gentoo.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sun, 08 Mar 2015 07:24:56 +0000 Received: from vapier (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with SMTP id E7AE5340706; Sun, 8 Mar 2015 07:24:53 +0000 (UTC) Date: Sun, 8 Mar 2015 03:24:53 -0400 From: Mike Frysinger To: Chen Gang , gdb-patches@sourceware.org Cc: eager@eagercon.com Subject: Re: [PATCH] sim/microblaze/interp.c: Use long int format instead of int to avoid compiling warnings Message-ID: <20150308072453.GV12857@vapier> Mail-Followup-To: Chen Gang , gdb-patches@sourceware.org, eager@eagercon.com References: <53B1FD76.7030500@gmail.com> <1444359.20hJbUDvYc@vapier> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1444359.20hJbUDvYc@vapier> X-IsSubscribed: yes On 02 Aug 2014 13:21, Mike Frysinger wrote: > On Tue 01 Jul 2014 08:14:46 Chen Gang wrote: > > sim patches only go to gdb-patches, so don't include cgen/binutils in the > future please > > > --- a/sim/microblaze/interp.c > > +++ b/sim/microblaze/interp.c > > > > if (len > (int) sizeof (unsigned long)) > > printf ("That operation is not available on integers of more than " > > - "%d bytes.", sizeof (unsigned long)); > > + "%ld bytes.", sizeof (unsigned long)); > > unfortunately, i don't believe this is correct. pretty sure the right answer > is %zu as sizeof() is a size_t. i've committed this now -mike From 3e95021c775db2c483e87033ebef3d42ff99c7e0 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 8 Mar 2015 03:24:03 -0400 Subject: [PATCH] sim: microblaze: fix printf string Since sizeof returns a size_t, use %zu to display it. --- sim/microblaze/ChangeLog | 4 ++++ sim/microblaze/interp.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sim/microblaze/ChangeLog b/sim/microblaze/ChangeLog index 0a068ff..e34a21d 100644 --- a/sim/microblaze/ChangeLog +++ b/sim/microblaze/ChangeLog @@ -1,3 +1,7 @@ +2015-03-08 Mike Frysinger + + * interp.c (microblaze_extract_unsigned_integer): Change %ld to %zu. + 2015-02-20 Mike Frysinger * interp.c: Delete sysdep.h and netinet/in.h includes. diff --git a/sim/microblaze/interp.c b/sim/microblaze/interp.c index 64850ef..ac2adb8 100644 --- a/sim/microblaze/interp.c +++ b/sim/microblaze/interp.c @@ -51,7 +51,7 @@ microblaze_extract_unsigned_integer (unsigned char *addr, int len) if (len > (int) sizeof (unsigned long)) printf ("That operation is not available on integers of more than " - "%ld bytes.", sizeof (unsigned long)); + "%zu bytes.", sizeof (unsigned long)); /* Start at the most significant end of the integer, and work towards the least significant. */