PATCH: eliminate bitmap.c warnings
Richard Guenther
richard.guenther@gmail.com
Fri Jan 16 11:49:00 GMT 2009
On Fri, Jan 16, 2009 at 5:47 AM, Ben Elliston <bje@au1.ibm.com> wrote:
> 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.
Ok.
Thanks,
Richard.
> Ben
>
>
> 2009-01-16 Ben Elliston <bje@au.ibm.com>
>
> * 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;
> else
> 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;
> #ifdef GATHER_STATISTICS
> register_overhead (map, -((int)sizeof (bitmap_head)));
> #endif
>
>
>
More information about the Gcc-patches
mailing list