Skip to content

Commit

Permalink
Fix #13030 (Checkers report: Misra C 8.13 is not executed unless --en…
Browse files Browse the repository at this point in the history
…able=style is used)
  • Loading branch information
danmar committed Aug 19, 2024
1 parent 55adeb4 commit e3c93f4
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/checkother.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1609,6 +1609,7 @@ void CheckOther::checkConstPointer()
{
if (!mSettings->severity.isEnabled(Severity::style) &&
!mSettings->isPremiumEnabled("constParameter") &&
!mSettings->isPremiumEnabled("constParameterPointer") &&
!mSettings->isPremiumEnabled("constParameterReference") &&
!mSettings->isPremiumEnabled("constPointer"))
return;
Expand Down
31 changes: 30 additions & 1 deletion lib/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,36 @@ void Settings::setCheckLevel(CheckLevel level)
}
}

// TODO: auto generate these tables
// These tables are auto generated from Cppcheck Premium script

static const std::set<std::string> cweCheckers{
"StlMissingComparison",
"assignBoolToPointer",
"autovarInvalidDeallocation",
"deallocuse",
"derefInvalidIterator",
"doubleFree",
"funcArgOrderDifferent",
"globalLockGuard",
"ignoredReturnValue",
"invalidTestForOverflow",
"invalidscanf",
"leakNoVarFunctionCall",
"leakReturnValNotUsed",
"localMutex",
"multiCondition",
"raceAfterInterlockedDecrement",
"resourceLeak",
"rethrowNoCurrentException",
"signConversion",
"signedCharArrayIndex",
"stlIfStrFind",
"unhandledExceptionSpecification",
"unknownEvaluationOrder",
"useClosedFile",
"varFuncNullUB",
"virtualDestructor"
};

static const std::set<std::string> autosarCheckers{
"accessMoved",
Expand Down

0 comments on commit e3c93f4

Please sign in to comment.