This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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?


2002-05-21  Andreas Jaeger  <>

	* 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]