[Libreoffice] [PATCH] [Janitor]: removed 'precedence' warnings.

Caolán McNamara caolanm at redhat.com
Thu Sep 30 05:34:34 PDT 2010

On Thu, 2010-09-30 at 14:22 +0200, Sebastian Spaeth wrote:
> On 2010-09-30, nthiebaud at gmail.com wrote:
> >      if(rSel.A() == rSel.B() &&
> > -        !rSel.A() || rSel.A() == nTextLen )
> > +       (!rSel.A() || rSel.A() == nTextLen ))
> While we change such code, would it be acceptable to also specify the
> purpose of the conditions in prose as to be able to understand what it
> actually happening?

Sure. With those && || warnings of course it's possible in some
circumstances that the true precedence actually being used by the
compiler *isn't* what the original developer thought he was doing, hence
the purpose of these gcc 4.[4|5] warnings. In doubt though, sticking
with the current logic clearly doesn't make things worse. Converting
them to prose and sanity checking the result to make sure its meaningful
is probably worthwhile, but comments always have to be taken with a
grain of salt :-)

Worth noting is that there's a list at
http://qa.openoffice.org/issues/showdependencytree.cgi?id=96084 of a lot
of the previous && || warnings. Some of the fixes there which are
integrated for OOo, are only fixed on the OOo 3.4 branch. So if you're
looking at && || warnings, have a look through that list to see if
there's already a fix available there to pull in.


More information about the LibreOffice mailing list