Added a few TODO comments

This commit is contained in:
Daniel Marjamäki 2018-11-20 22:57:01 +01:00
parent 36a84c5406
commit 9d8e5e36eb
5 changed files with 4 additions and 1 deletions

View File

@ -3,4 +3,3 @@
<define name="TEST(A,B)" value="void __ ## A ## _ ## B ( )"/>
<define name="TEST_F(A,B)" value="void __ ## A ## _ ## B ( )"/>
</def>

View File

@ -668,6 +668,7 @@ const Token * CheckLeakAutoVar::checkTokenInsideExpression(const Token * const t
{
// Deallocation and then dereferencing pointer..
if (tok->varId() > 0) {
// TODO : Write a separate checker for this that uses valueFlowForward.
const std::map<unsigned int, VarInfo::AllocInfo>::const_iterator var = varInfo->alloctype.find(tok->varId());
if (var != varInfo->alloctype.end()) {
bool unknown = false;

View File

@ -2035,6 +2035,7 @@ void CheckMemoryLeakInFunction::checkScope(const Token *startTok, const std::str
tok2->deleteNext();
}
if ((result = Token::findmatch(tok, "[;{}] dealloc ; use_ ;")) != nullptr) {
// TODO : Write a separate checker for this that uses valueFlowForward.
deallocuseError(result->tokAt(3), varname);
}

View File

@ -473,6 +473,7 @@ static bool checkExceptionHandling(const Token* tok)
void CheckOther::checkRedundantAssignment()
{
// TODO: This function should be rewritten, it's far too complex.
const bool printPerformance = mSettings->isEnabled(Settings::PERFORMANCE);
const bool printStyle = mSettings->isEnabled(Settings::STYLE);
const bool printWarning = mSettings->isEnabled(Settings::WARNING);

View File

@ -3946,6 +3946,7 @@ static void valueFlowSubFunction(TokenList *tokenlist, ErrorLogger *errorLogger,
if (!calledFunctionScope)
continue;
// TODO: Rewrite this. It does not work well to inject 1 argument at a time.
const std::vector<const Token *> &callArguments = getArguments(tok);
for (unsigned int argnr = 0U; argnr < callArguments.size(); ++argnr) {
const Token *argtok = callArguments[argnr];