From: Ivan Maidanski Date: Fri, 30 Sep 2011 13:32:47 +0000 (+0400) Subject: Resolve some minor warnings reported by GCC with '-pedantic' option X-Git-Tag: gc7_3alpha2~325 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aa335f7778a1c834bca57d36fa823a2a8999c51f;p=gc Resolve some minor warnings reported by GCC with '-pedantic' option * allchblk.c (GC_print_hblkfreelist, GC_dump_regions, GC_freehblk): Explicitly cast a pointer argument of GC_printf to void* to match %p format specifier. * reclaim.c (GC_print_free_list): Likewise. --- diff --git a/allchblk.c b/allchblk.c index dc35bc28..77e036a9 100644 --- a/allchblk.c +++ b/allchblk.c @@ -127,7 +127,8 @@ void GC_print_hblkfreelist(void) hhdr = HDR(h); sz = hhdr -> hb_sz; total_free += sz; - GC_printf("\t%p size %lu %s black listed\n", h, (unsigned long)sz, + GC_printf("\t%p size %lu %s black listed\n", + (void *)h, (unsigned long)sz, GC_is_black_listed(h, HBLKSIZE) != 0 ? "start" : GC_is_black_listed(h, hhdr -> hb_sz) != 0 ? "partially" : "not"); @@ -182,7 +183,7 @@ void GC_dump_regions(void) for (p = start; p < end;) { hhdr = HDR(p); if (IS_FORWARDING_ADDR_OR_NIL(hhdr)) { - GC_printf("\t%p Missing header!!(%p)\n", p, hhdr); + GC_printf("\t%p Missing header!!(%p)\n", p, (void *)hhdr); p += HBLKSIZE; continue; } @@ -848,7 +849,8 @@ GC_INNER void GC_freehblk(struct hblk *hbp) /* Check for duplicate deallocation in the easy case */ if (HBLK_IS_FREE(hhdr)) { if (GC_print_stats) - GC_log_printf("Duplicate large block deallocation of %p\n", hbp); + GC_log_printf("Duplicate large block deallocation of %p\n", + (void *)hbp); ABORT("Duplicate large block deallocation"); } diff --git a/reclaim.c b/reclaim.c index 405087b8..3d4a81d1 100644 --- a/reclaim.c +++ b/reclaim.c @@ -461,7 +461,7 @@ void GC_print_free_list(int kind, size_t sz_in_granules) for (n = 1; flh; n++) { struct hblk *block = HBLKPTR(flh); if (block != lastBlock) { - GC_printf("\nIn heap block at %p:\n\t", block); + GC_printf("\nIn heap block at %p:\n\t", (void *)block); lastBlock = block; } GC_printf("%d: %p;", n, flh);