This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Fix warning in ggc-page about printf format
- From: Andreas Jaeger <aj at suse dot de>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 21 May 2002 15:05:05 +0200
- Subject: Fix warning in ggc-page about printf format
On a 64-bit host I get this warning:
/sources/gcc/gcc/gcc/ggc-page.c:1506: warning: int format, different type arg (arg 3)
The problem is that we're printing an entry of this array:
static size_t object_size_table[NUM_ORDERS];
with "%-5d".
Here's a patch. Bootstrapped/regtested on i686-linux-gnu.
Ok to commit?
Andreas
2002-05-21 Andreas Jaeger <aj@suse.de>
* ggc-page.c (ggc_print_statistics): Avoid printf mismatch warnings.
============================================================
Index: gcc/ggc-page.c
--- gcc/ggc-page.c 3 Mar 2002 14:07:19 -0000 1.49
+++ gcc/ggc-page.c 21 May 2002 07:17:23 -0000
@@ -1500,7 +1500,7 @@ ggc_print_statistics ()
overhead += (sizeof (page_entry) - sizeof (long)
+ BITMAP_SIZE (OBJECTS_PER_PAGE (i) + 1));
}
- fprintf (stderr, "%-5d %10ld%c %10ld%c %10ld%c\n", OBJECT_SIZE (i),
+ fprintf (stderr, "%-5ld %10ld%c %10ld%c %10ld%c\n", (long)OBJECT_SIZE (i),
SCALE (allocated), LABEL (allocated),
SCALE (in_use), LABEL (in_use),
SCALE (overhead), LABEL (overhead));
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj