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 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
--


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