Mutual exclusion: Disable this check until #2162 is fixed.
This commit is contained in:
parent
27cae2f0d7
commit
fd64a7e683
|
@ -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?");
|
||||
}
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -104,6 +104,7 @@ private:
|
|||
// Check..
|
||||
Settings settings;
|
||||
settings._checkCodingStyle = true;
|
||||
settings.inconclusive = true;
|
||||
CheckOther checkOther(&tokenizer, &settings, this);
|
||||
|
||||
// Clear the error buffer..
|
||||
|
|
Loading…
Reference in New Issue