CheckIO: Handle library types
This commit is contained in:
parent
977af89fa9
commit
86ef5f8ae7
|
@ -652,7 +652,7 @@ void CheckIO::checkWrongPrintfScanfArguments()
|
|||
// Perform type checks
|
||||
ArgumentInfo argInfo(argListTok, _settings);
|
||||
|
||||
if (argInfo.typeToken) {
|
||||
if (argInfo.typeToken && !argInfo.isLibraryType(_settings)) {
|
||||
if (scan) {
|
||||
std::string specifier;
|
||||
bool done = false;
|
||||
|
@ -1618,6 +1618,11 @@ bool CheckIO::ArgumentInfo::isKnownType() const
|
|||
return typeToken->isStandardType() || Token::Match(typeToken, "std :: string|wstring");
|
||||
}
|
||||
|
||||
bool CheckIO::ArgumentInfo::isLibraryType(const Settings *settings) const
|
||||
{
|
||||
return typeToken && typeToken->isStandardType() && settings->library.podtype(typeToken->str());
|
||||
}
|
||||
|
||||
void CheckIO::wrongPrintfScanfArgumentsError(const Token* tok,
|
||||
const std::string &functionName,
|
||||
unsigned int numFormat,
|
||||
|
|
|
@ -78,6 +78,7 @@ private:
|
|||
bool isKnownType() const;
|
||||
bool isStdVectorOrString();
|
||||
bool isStdContainer(const Token *tok);
|
||||
bool isLibraryType(const Settings *settings) const;
|
||||
|
||||
const Variable *variableInfo;
|
||||
const Token *typeToken;
|
||||
|
|
Loading…
Reference in New Issue