[PATCH][committed] Fix bootstrap with --enable-gather-detailed-mem-stats

Richard Guenther rguenther@suse.de
Tue Nov 28 10:07:00 GMT 2006


It's broken because of a warning printing a size_t with %d.  Fixed
by doing what all other places do, print size_t as %ul and cast the
value to unsigned long.

Bootstrapped on x86_64-unknown-linux-gnu, applied as obvious.

Richard.

2006-11-28  Richard Guenther  <rguenther@suse.de>

	* ggc-page.c (ggc_print_statistics): Use %ul and a cast to
	unsigned long for printing OBJECT_SIZE.

Index: ggc-page.c
===================================================================
*** ggc-page.c	(revision 119279)
--- ggc-page.c	(working copy)
*************** ggc_print_statistics (void)
*** 2017,2026 ****
      for (i = 0; i < NUM_ORDERS; i++)
        if (G.stats.total_allocated_per_order[i])
          {
!           fprintf (stderr, "Total Overhead  page size %7d:     %10lld\n",
!                    OBJECT_SIZE (i), G.stats.total_overhead_per_order[i]);
!           fprintf (stderr, "Total Allocated page size %7d:     %10lld\n",
!                    OBJECT_SIZE (i), G.stats.total_allocated_per_order[i]);
          }
    }
  #endif
--- 2017,2028 ----
      for (i = 0; i < NUM_ORDERS; i++)
        if (G.stats.total_allocated_per_order[i])
          {
!           fprintf (stderr, "Total Overhead  page size %7ul:     %10lld\n",
!                    (unsigned long) OBJECT_SIZE (i),
! 		   G.stats.total_overhead_per_order[i]);
!           fprintf (stderr, "Total Allocated page size %7ul:     %10lld\n",
!                    (unsigned long) OBJECT_SIZE (i),
! 		   G.stats.total_allocated_per_order[i]);
          }
    }
  #endif



More information about the Gcc-patches mailing list