This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: patches for Irix binutils 2.18 -- removal of some casts
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Jay <jay dot krell at cornell dot edu>
- Cc: binutils at sourceware dot org
- Date: Wed, 22 Oct 2008 10:01:08 +1030
- Subject: Re: patches for Irix binutils 2.18 -- removal of some casts
- References: <1224626969.18657.ezmlm@sourceware.org> <COL101-W15DC63349702412C774E3E62E0@phx.gbl>
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