Resolve some minor warnings reported by GCC with '-pedantic' option
authorIvan Maidanski <ivmai@mail.ru>
Fri, 30 Sep 2011 13:32:47 +0000 (17:32 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 30 Sep 2011 13:32:47 +0000 (17:32 +0400)
* 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.

allchblk.c
reclaim.c

index dc35bc2..77e036a 100644 (file)
@@ -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");
       }
 
index 405087b..3d4a81d 100644 (file)
--- 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);