This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: patches for Irix binutils 2.18 -- removal of some casts


On Tue, Oct 21, 2008 at 10:39:10PM +0000, Jay wrote:
> Do you care about making or leaving the code C++ compatible?

Not at all.

> Some of your change removes C++ compat.

I've been bitten by bugs that would have been obvious except that
someone had hidden them with a cast.  I don't like unnecessary code..

Here's an example from a recent gcc bug report of a problem caused by
adding an unnecessary cast from void ** to long **:

void foo (int count, void **p)
{
  while (--count >= 0)
    {
      long *q = *(long **)(--p);
      *p = 0;
      printf ("%p\n", q);
    }
}

If you can't immediately spot the problem, you're not alone!

-- 
Alan Modra
Australia Development Lab, IBM


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