libreoffice + clang == success
Tor Lillqvist
tml at iki.fi
Thu Mar 1 06:27:25 PST 2012
> FYI, I also decided to start doing the iOS builds using clang.
Whoa, compiling with Clang really reveals some interesting
thinko-style bugs in the code. Bugs so old that it is hard to say
whether it is riskier to fix them and better to let the code be as is
(and work as it has worked all the time) even if it actually does
something different than what the author might originally have
intended.
Like this:
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -2466,7 +2466,7 @@ static void lcl_AddToPropertyContainer
uno::Any aAny(C2U(""));
xPropContainer->addProperty
(rPropertyName,
- static_cast<sal_Int16>(beans::PropertyAttribute::BOUND ||
+ static_cast<sal_Int16>(beans::PropertyAttribute::BOUND |
beans::PropertyAttribute::REMOVABLE),
aAny);
}
I.e. the code has until now passed the result of a *logical* OR or two
non-zero values, i.e. the value 1, which is
beans::PropertyAttribute::MAYBEVOID, even if the author presumably
wanted the *bitwise* OR of the two attribute bits.
So if this is code that actually is invoked now and then, and hasn't
caused any bugs (?), is it then risky to "fix" it? (Well, I did fix it
anyway.)
--tml
More information about the LibreOffice
mailing list