Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix #11604 Debug: DacaWrongData
  • Loading branch information
web-flow committed Jul 23, 2026
commit ec17bfce6ce5276bfe8340b976bcaeb6b7e2a57e
3 changes: 0 additions & 3 deletions lib/check.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ class Settings;
class ErrorLogger;
class Tokenizer;

/** Use WRONG_DATA in checkers to mark conditions that check that data is correct */
#define WRONG_DATA(COND, TOK) ((COND) && wrongData((TOK), #COND))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this mean that wrongData is never used and can be removed also?


/// @addtogroup Core
/// @{

Expand Down
7 changes: 0 additions & 7 deletions lib/checkimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@ void CheckImpl::reportError(ErrorPath errorPath, Severity severity, const char i
mErrorLogger.reportErr(errmsg);
}

bool CheckImpl::wrongData(const Token *tok, const char *str)
{
if (mSettings.daca)
reportError(tok, Severity::debug, "DacaWrongData", "Wrong data detected by condition " + std::string(str));
return true;
}

ErrorPath CheckImpl::getErrorPath(const Token* errtok, const ValueFlow::Value* value, std::string bug) const
{
ErrorPath errorPath;
Expand Down
6 changes: 0 additions & 6 deletions lib/checkimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,6 @@ class CPPCHECKLIB CheckImpl

ErrorPath getErrorPath(const Token* errtok, const ValueFlow::Value* value, std::string bug) const;

/**
* Use WRONG_DATA in checkers when you check for wrong data. That
* will call this method
*/
bool wrongData(const Token *tok, const char *str);

public: // TODO: should be protected
void logChecker(const char id[]);
};
Expand Down
Loading