PATCH RFA: Fix -Wparentheses fallout

Ian Lance Taylor iant@google.com
Tue Jan 9 05:13:00 GMT 2007


Daniel Jacobowitz <drow@false.org> writes:

> On Sun, Jan 07, 2007 at 09:16:37PM -0800, Ian Lance Taylor wrote:
> > +bool
> > +bar ()
> > +{
> > +  c = a = b;
> > +  foo (0);
> > +  return a = b;
> > +}
> 
> Maybe it's just me, but I think that second one deserves a warning.
> If it's possible to distinguish the two, anyway.

Hmmm.  I guess I don't think it deserves a warning.  Consider

int glob;
int
foo (int i)
{
  return glob = i;
}

It seems to me that we shouldn't warn about that.  And it is
isomorphic to the example with bool (in the code quoted above, all
variables have type bool).

Any other opinions?

Ian



More information about the Gcc-patches mailing list