public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
From: Chen Gang <gang.chen.5i5j@gmail.com>
To: eager@eagercon.com
Cc: vapier@gentoo.org, cgen@sourceware.org, binutils@sourceware.org,
	 gdb-patches@sourceware.org
Subject: [PATCH] sim/microblaze/interp.c: Use long int format instead of int to avoid compiling warnings
Date: Tue, 01 Jul 2014 00:15:00 -0000	[thread overview]
Message-ID: <53B1FD76.7030500@gmail.com> (raw)

The related warnings (cross compile microblaze-linux-elf):

  ../../../binutils-gdb/sim/microblaze/interp.c: In function ‘microblaze_extract_unsigned_integer’:
  ../../../binutils-gdb/sim/microblaze/interp.c:53:6: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat]
  ../../../binutils-gdb/sim/microblaze/interp.c: In function ‘sim_size’:
  ../../../binutils-gdb/sim/microblaze/interp.c:329:4: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long unsigned int’ [-Wformat]
  ../../../binutils-gdb/sim/microblaze/interp.c: In function ‘set_initial_gprs’:
  ../../../binutils-gdb/sim/microblaze/interp.c:360:7: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long unsigned int’ [-Wformat]
  ../../../binutils-gdb/sim/microblaze/interp.c:360:7: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘long unsigned int’ [-Wformat]


Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
 sim/ChangeLog           | 5 +++++
 sim/microblaze/interp.c | 6 +++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/sim/ChangeLog b/sim/ChangeLog
index 35d0920..03c244b 100644
--- a/sim/ChangeLog
+++ b/sim/ChangeLog
@@ -1,3 +1,8 @@
+2014-07-01  Chen Gang <gang.chen.5i5j@gmail.com>
+
+	* sim/microblaze/interp.c: Use long int format instead of int
+	format to avoid compiling warnings.
+
 2014-03-12  Nick Clifton  <nickc@redhat.com>
 
 	* MAINTAINERS: Add myself as the maintainer for the MSP430.
diff --git a/sim/microblaze/interp.c b/sim/microblaze/interp.c
index cc61278..e92a1d0 100644
--- a/sim/microblaze/interp.c
+++ b/sim/microblaze/interp.c
@@ -50,7 +50,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 "
-	    "%d bytes.", sizeof (unsigned long));
+	    "%ld bytes.", sizeof (unsigned long));
 
   /* Start at the most significant end of the integer, and work towards
      the least significant.  */
@@ -325,7 +325,7 @@ sim_size (int size)
     {
       if (issue_messages)
 	fprintf (stderr,
-		 "Not enough VM for simulation of %d bytes of RAM\n",
+		 "Not enough VM for simulation of %ld bytes of RAM\n",
 		 CPU.msize);
 
       CPU.msize = 1;
@@ -356,7 +356,7 @@ set_initial_gprs ()
   memsize = CPU.msize / (1024 * 1024);
 
   if (issue_messages > 1)
-    fprintf (stderr, "Simulated memory of %d Mbytes (0x0 .. 0x%08x)\n",
+    fprintf (stderr, "Simulated memory of %ld Mbytes (0x0 .. 0x%08lx)\n",
 	     memsize, CPU.msize - 1);
 
   /* Clean out the GPRs */
-- 
1.9.2.459.g68773ac

             reply	other threads:[~2014-07-01  0:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-01  0:15 Chen Gang [this message]
2014-07-01  0:43 ` Michael Eager
2014-07-01  1:08   ` Chen Gang
2014-07-01  1:11     ` Michael Eager

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=53B1FD76.7030500@gmail.com \
    --to=gang.chen.5i5j@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=cgen@sourceware.org \
    --cc=eager@eagercon.com \
    --cc=gdb-patches@sourceware.org \
    --cc=vapier@gentoo.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).