diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 3628b2f89..d6197c56f 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -220,6 +220,10 @@ void CheckOther::checkAssignmentInAssert() //--------------------------------------------------------------------------- void CheckOther::checkIncorrectLogicOperator() { + // Inconclusive until #2162 is fixed: + if (!_settings->inconclusive) + return; + if (!_settings->_checkCodingStyle) return; @@ -2639,6 +2643,8 @@ void CheckOther::assignmentInAssertError(const Token *tok, const std::string &va void CheckOther::incorrectLogicOperatorError(const Token *tok) { + if (!_settings->inconclusive) + return; reportError(tok, Severity::warning, "incorrectLogicOperator", "Mutual exclusion over || always evaluates to true. Did you intend to use && instead?"); } diff --git a/lib/checkother.h b/lib/checkother.h index bc4af9f10..da5f2e78c 100644 --- a/lib/checkother.h +++ b/lib/checkother.h @@ -251,7 +251,7 @@ public: "* look for 'sizeof sizeof ..'\n" "* look for calculations inside sizeof()\n" "* assignment of a variable to itself\n" - "* mutual exclusion over || always evaluating to true\n" + //"* mutual exclusion over || always evaluating to true\n" // optimisations "* optimisation: detect post increment/decrement\n"; diff --git a/test/testother.cpp b/test/testother.cpp index 6bbcb1f4d..9ff6c5175 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -104,6 +104,7 @@ private: // Check.. Settings settings; settings._checkCodingStyle = true; + settings.inconclusive = true; CheckOther checkOther(&tokenizer, &settings, this); // Clear the error buffer..