Mutual exclusion: Disable this check until #2162 is fixed.

This commit is contained in:
Daniel Marjamäki 2010-11-20 07:43:07 +01:00
parent 27cae2f0d7
commit fd64a7e683
3 changed files with 8 additions and 1 deletions

View File

@ -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?");
}

View File

@ -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";

View File

@ -104,6 +104,7 @@ private:
// Check..
Settings settings;
settings._checkCodingStyle = true;
settings.inconclusive = true;
CheckOther checkOther(&tokenizer, &settings, this);
// Clear the error buffer..