PATCH: eliminate bitmap.c warnings

Ben Elliston
Fri Jan 16 05:04:00 GMT 2009

Currently, there are three outstanding warnings produced by building
with -Wc++-compat: all three relate to implicit conversions from void*.
I believe this patch fixes two of them, but I am left with a feeling
that if it were this simple, it would have already been fixed.  Am I
missing something?  Tested with a bootstrap on i686-pc-linux-gnu.


2009-01-16  Ben Elliston  <>

        * bitmap.c (bitmap_obstack_alloc_stat): Adjust cast to eliminate
        C++ warning about implicit conversion from void * to struct
        bitmap_head_def *.
        (bitmap_obstack_free): Likewise for bitmap_element *.

Index: bitmap.c
--- bitmap.c    (revision 143421)
+++ bitmap.c    (working copy)
@@ -356,7 +356,7 @@ bitmap_obstack_alloc_stat (bitmap_obstac
     bit_obstack = &bitmap_default_obstack;
   map = bit_obstack->heads;
   if (map)
-    bit_obstack->heads = (void *)map->first;
+    bit_obstack->heads = (struct bitmap_head_def *) map->first;
     map = XOBNEW (&bit_obstack->obstack, bitmap_head);
   bitmap_initialize_stat (map, bit_obstack PASS_MEM_STAT);
@@ -391,7 +391,7 @@ bitmap_obstack_free (bitmap map)
   if (map)
       bitmap_clear (map);
-      map->first = (void *)map->obstack->heads;
+      map->first = (bitmap_element *) map->obstack->heads;
       register_overhead (map, -((int)sizeof (bitmap_head)));

More information about the Gcc-patches mailing list