enable moduloofone reports only with --enable=style (#2747)

... because it is reported with Severity::style
This commit is contained in:
Kamil Dudka 2020-08-21 20:43:03 +02:00 committed by GitHub
parent b56732ef20
commit 33fb0e782e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -3151,6 +3151,9 @@ void CheckOther::comparePointersError(const Token *tok, const ValueFlow::Value *
void CheckOther::checkModuloOfOne() void CheckOther::checkModuloOfOne()
{ {
if (!mSettings->isEnabled(Settings::STYLE))
return;
for (const Token *tok = mTokenizer->tokens(); tok; tok = tok->next()) { for (const Token *tok = mTokenizer->tokens(); tok; tok = tok->next()) {
if (!tok->astOperand2() || !tok->astOperand1()) if (!tok->astOperand2() || !tok->astOperand1())
continue; continue;