Hello,
Cppcheck reports this in sdext module :
[source/minimizer/optimizerdialog.cxx:276]: (warning) Logical disjunction
always evaluates to true: nNewStep >= 0 || nNewStep <= 4
Here is the line :
if ( ( nNewStep != mnCurrentStep ) && ( ( nNewStep <= MAX_STEP ) || (
nNewStep >= 0 ) ) )
Shouldn't it be :
if ( ( nNewStep != mnCurrentStep ) && ( nNewStep <= MAX_STEP ) && ( nNewStep
= 0 ) )
?
Moreover, if I'm right, should we additionnally throw an exception (which
one ?) if "nNewStep" is not between 0 and MAX_STEP
If ok for just the condition change, I can commit and push on master (what
about 3.5 ?)
About the exception, I don't know what to put.
Julien.
--
View this message in context:
http://nabble.documentfoundation.org/Cppcheck-reports-Logical-disjunction-always-evaluates-to-true-in-sdext-module-tp3836919p3836919.html
Sent from the Dev mailing list archive at Nabble.com.
Context
- Cppcheck reports "Logical disjunction always evaluates to true" in sdext module · julien2412
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.