This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: eliminate -Wc++compat-warning from dominance.c


On Thu, Jan 22, 2009 at 5:10 AM, Ben Elliston <bje@au1.ibm.com> wrote:
> On Tue, 2009-01-20 at 09:55 +0100, Richard Guenther wrote:
>
>> No.  Can you instead try fixing BITMAP_FREE to do sth like
>>
>> #define BITMAP_FREE(BITMAP)                   \
>>        ((void)(bitmap_obstack_free (__builtin_types_compatible_p
>> (BITMAP, void *) ? (bitmap)BITMAP : BITMAP), (BITMAP) = NULL))
>
>> guarded properly for GCC being available.  The idea would be to allow
>> void * arguments but not other pointer arguments here.
>
> On further thought, this really isn't achieving much.  By using a void*
> for the miscellaneous data field in struct vertex, we've already thrown
> type safety out the window.  Why not just unconditionally cast to
> (bitmap) in this macro?

Well, it's not only used on void * pointer variables so we may as well
want to prohibit use on lets say bitmap * variables (if somebody
forgot a dereference).

Richard.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]