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] regrename.c: Fix a warning.


> On Wed, Jan 14, 2004 at 06:01:32PM +0000, Richard Earnshaw wrote:
> > Hmm, the assignment was always inside the conditional, but wasn't on it's 
> > own before -- perhaps that's a weakness in our warning heuristic.
> 
> Nope.  The extra () heuristic,
> 
> 	if ((var = val))
> 
> is explicitly intended to suppress the warning.  Indeed, that's the
> fix that the warning suggests.  You removed the extra parenthesis.
>
Yep.  I can't say I much like that idiom.  I'd much rather see

	if ((var = val) != 0)

making the comparison explicit.

But that's personal preference.

R.


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