This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix combine.c compilation warnings.
- From: Roger Sayle <roger at eyesopen dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 2 Jul 2002 19:06:37 -0600 (MDT)
- Subject: Re: [PATCH] Fix combine.c compilation warnings.
On Tue, 2 Jul 2002, Richard Henderson wrote:
> On Sat, Jun 29, 2002 at 01:10:50PM -0600, Roger Sayle wrote:
> > ! #define SUBST_INT(INTO, NEWVAL) do_SUBST_INT((unsigned int*) &(INTO), \
> > ! (NEWVAL))
>
> I don't like this. It'll prevent us from ever seeing
> actually incorrect code.
I must admit that I'm not very happy with it myself.
Would you be happier changing the single SUBST_INT caller to:
SUBST_INT ((unsigned int) XVECLEN (pat, 0), pos);
which for some unknown reason, I had a strange aversion to
when writing the original patch?
The other possible solution is to get rid of the "SUBST_INT" macro
all together, rename the function "do_SUBST_INT" to "SUBST_INT" and
modify the caller to pass a pointer as first argument (with the
appropriate cast at the call site). This would unfortunatley break
the symmetry between SUBST and SUBST_INT, but expose the pass-by-ref
argument.
In which case, you'd probably ask me to similarly change SUBST at
the same time.
Roger
--