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] Fix PR c++/4401


>>>>> "Jakub" == Jakub Jelinek <jakub@redhat.com> writes:

> On Wed, Feb 20, 2002 at 02:00:06PM +0000, Jason Merrill wrote:
>> >>>>> "Jakub" == Jakub Jelinek <jakub@redhat.com> writes:
>> 
>> > Ok to commit?
>> 
>> Rather than this, please delete pointer_int_sum from the C++ frontend and
>> move the version from the C frontend into c-common.c.

> They have different warnings (e.g. the C version doesn't
> warn about arithmetic on METHOD_TYPE or OFFSET_TYPE).

Then copy that code over from the C++ version.  There's no reason a
function in c-common can't handle those types.

> It might be possible to merge the rest of the functions into some helper
> function in c-common.c, but after deleting the redundant part with fold
> the functions minus the warnings part don't look long enough to justify
> this IMHO.

The reason to do this is to avoid bugs like this one; it looks like someone
already fixed it in the C frontend.  If the code had been shared with C++,
it would have been fixed there for free.  Even if the extra code in the if
doesn't actually fix this bug, reducing code duplication is always
worthwhile.

Jason


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