@@ -1576,7 +1576,7 @@ void CheckOther::variableScopeError(const Token *tok, const std::string &varname
15761576// ---------------------------------------------------------------------------
15771577void CheckOther::checkConstantFunctionParameter ()
15781578{
1579- if (!_settings->isEnabled (" style " ))
1579+ if (!_settings->isEnabled (" performance " ))
15801580 return ;
15811581
15821582 const SymbolDatabase * const symbolDatabase = _tokenizer->getSymbolDatabase ();
@@ -2368,7 +2368,7 @@ void CheckOther::duplicateExpressionError(const Token *tok1, const Token *tok2,
23682368// ---------------------------------------------------------------------------
23692369void CheckOther::checkAlwaysTrueOrFalseStringCompare ()
23702370{
2371- if (!_settings->isEnabled (" style" ))
2371+ if (!_settings->isEnabled (" style" ) && !_settings-> isEnabled ( " performance " ) )
23722372 return ;
23732373
23742374 const char pattern1[] = " strcmp|stricmp|strcmpi|strcasecmp|wcscmp ( %str% , %str% )" ;
@@ -2403,7 +2403,7 @@ void CheckOther::alwaysTrueFalseStringCompareError(const Token *tok, const std::
24032403 " If the purpose is to compare these two strings, the comparison is unnecessary. "
24042404 " If the strings are supposed to be different, then there is a bug somewhere." );
24052405 }
2406- else
2406+ else if (_settings-> isEnabled ( " performance " ))
24072407 {
24082408 reportError (tok, Severity::performance, " staticStringCompare" ,
24092409 " Unnecessary comparison of static strings.\n "
0 commit comments