Skip to content

Commit 10a5a16

Browse files
authored
Premium: Enable bitwiseOnBoolean if --premium=cert-c-2016 option is used (#7714)
1 parent ef195b8 commit 10a5a16

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/checkbool.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,11 @@ static bool isConvertedToBool(const Token* tok)
9090
//---------------------------------------------------------------------------
9191
void CheckBool::checkBitwiseOnBoolean()
9292
{
93-
if (!mSettings->severity.isEnabled(Severity::style))
94-
return;
95-
96-
// danmar: this is inconclusive because I don't like that there are
97-
// warnings for calculations. Example: set_flag(a & b);
98-
if (!mSettings->certainty.isEnabled(Certainty::inconclusive))
93+
if (!mSettings->isPremiumEnabled("bitwiseOnBoolean") &&
94+
!mSettings->severity.isEnabled(Severity::style) &&
95+
// danmar: this is inconclusive because I don't like that there are
96+
// warnings for calculations. Example: set_flag(a & b);
97+
!mSettings->certainty.isEnabled(Certainty::inconclusive))
9998
return;
10099

101100
logChecker("CheckBool::checkBitwiseOnBoolean"); // style,inconclusive

0 commit comments

Comments
 (0)