| 
    Cppcheck
    
   | 
 
Library definitions handling. More...
#include <library.h>
Classes | |
| struct | AllocFunc | 
| struct | ArgumentChecks | 
| class | CodeBlock | 
| class | Container | 
| class | Error | 
| class | ExportedFunctions | 
| struct | Function | 
| struct | NonOverlappingData | 
| struct | Platform | 
| struct | PlatformType | 
| struct | PodType | 
| struct | SmartPointer | 
| struct | WarnInfo | 
Public Types | |
| enum class | ErrorCode {  OK , FILE_NOT_FOUND , BAD_XML , UNKNOWN_ELEMENT , MISSING_ATTRIBUTE , BAD_ATTRIBUTE_VALUE , UNSUPPORTED_FORMAT , DUPLICATE_PLATFORM_TYPE , PLATFORM_TYPE_REDEFINED , DUPLICATE_DEFINE }  | 
| enum class | UseRetValType { NONE , DEFAULT , ERROR_CODE } | 
| enum class | TypeCheck { def , check , suppress , checkFiniteLifetime } | 
| Suppress/check a type.  More... | |
Public Member Functions | |
| Library ()=default | |
| Error | load (const char exename[], const char path[]) | 
| Error | load (const tinyxml2::XMLDocument &doc) | 
| const AllocFunc * | getAllocFuncInfo (const Token *tok) const | 
| get allocation info for function  More... | |
| const AllocFunc * | getDeallocFuncInfo (const Token *tok) const | 
| get deallocation info for function  More... | |
| const AllocFunc * | getReallocFuncInfo (const Token *tok) const | 
| get reallocation info for function  More... | |
| int | getAllocId (const Token *tok, int arg) const | 
| get allocation id for function  More... | |
| int | getDeallocId (const Token *tok, int arg) const | 
| get deallocation id for function  More... | |
| int | getReallocId (const Token *tok, int arg) const | 
| get reallocation id for function  More... | |
| const AllocFunc * | getAllocFuncInfo (const char name[]) const | 
| get allocation info for function by name (deprecated, use other alloc)  More... | |
| const AllocFunc * | getDeallocFuncInfo (const char name[]) const | 
| get deallocation info for function by name (deprecated, use other alloc)  More... | |
| int | allocId (const char name[]) const | 
| get allocation id for function by name (deprecated, use other alloc)  More... | |
| int | deallocId (const char name[]) const | 
| get deallocation id for function by name (deprecated, use other alloc)  More... | |
| bool | formatstr_function (const Token *ftok) const | 
| int | formatstr_argno (const Token *ftok) const | 
| bool | formatstr_scan (const Token *ftok) const | 
| bool | formatstr_secure (const Token *ftok) const | 
| const NonOverlappingData * | getNonOverlappingData (const Token *ftok) const | 
| const WarnInfo * | getWarnInfo (const Token *ftok) const | 
| bool | isNotLibraryFunction (const Token *ftok) const | 
| bool | matchArguments (const Token *ftok, const std::string &functionName) const | 
| UseRetValType | getUseRetValType (const Token *ftok) const | 
| const std::string & | returnValue (const Token *ftok) const | 
| const std::string & | returnValueType (const Token *ftok) const | 
| int | returnValueContainer (const Token *ftok) const | 
| std::vector< MathLib::bigint > | unknownReturnValues (const Token *ftok) const | 
| bool | isnoreturn (const Token *ftok) const | 
| bool | isnotnoreturn (const Token *ftok) const | 
| bool | isScopeNoReturn (const Token *end, std::string *unknownFunc) const | 
| const Container * | detectContainer (const Token *typeStart) const | 
| const Container * | detectIterator (const Token *typeStart) const | 
| const Container * | detectContainerOrIterator (const Token *typeStart, bool *isIterator=nullptr, bool withoutStd=false) const | 
| const Function * | getFunction (const Token *ftok) const | 
| bool | isUse (const std::string &functionName) const | 
| bool | isLeakIgnore (const std::string &functionName) const | 
| bool | isFunctionConst (const std::string &functionName, bool pure) const | 
| bool | isFunctionConst (const Token *ftok) const | 
| bool | isboolargbad (const Token *ftok, int argnr) const | 
| bool | isnullargbad (const Token *ftok, int argnr) const | 
| bool | isuninitargbad (const Token *ftok, int argnr, int indirect=0, bool *hasIndirect=nullptr) const | 
| bool | isargformatstr (const Token *ftok, int argnr) const | 
| bool | isargstrz (const Token *ftok, int argnr) const | 
| bool | isIntArgValid (const Token *ftok, int argnr, const MathLib::bigint argvalue) const | 
| bool | isFloatArgValid (const Token *ftok, int argnr, double argvalue) const | 
| const std::string & | validarg (const Token *ftok, int argnr) const | 
| const ArgumentChecks::IteratorInfo * | getArgIteratorInfo (const Token *ftok, int argnr) const | 
| bool | hasminsize (const Token *ftok) const | 
| const std::vector< ArgumentChecks::MinSize > * | argminsizes (const Token *ftok, int argnr) const | 
| ArgumentChecks::Direction | getArgDirection (const Token *ftok, int argnr) const | 
| bool | markupFile (const std::string &path) const | 
| bool | processMarkupAfterCode (const std::string &path) const | 
| const std::set< std::string > & | markupExtensions () const | 
| bool | reportErrors (const std::string &path) const | 
| bool | ignorefunction (const std::string &functionName) const | 
| bool | isexecutableblock (const std::string &file, const std::string &token) const | 
| int | blockstartoffset (const std::string &file) const | 
| const std::string & | blockstart (const std::string &file) const | 
| const std::string & | blockend (const std::string &file) const | 
| bool | iskeyword (const std::string &file, const std::string &keyword) const | 
| bool | isexporter (const std::string &prefix) const | 
| bool | isexportedprefix (const std::string &prefix, const std::string &token) const | 
| bool | isexportedsuffix (const std::string &prefix, const std::string &token) const | 
| bool | isimporter (const std::string &file, const std::string &importer) const | 
| const Token * | getContainerFromYield (const Token *tok, Container::Yield yield) const | 
| const Token * | getContainerFromAction (const Token *tok, Container::Action action) const | 
| bool | isreflection (const std::string &token) const | 
| int | reflectionArgument (const std::string &token) const | 
| bool | isentrypoint (const std::string &func) const | 
| bool | isSmartPointer (const Token *tok) const | 
| const SmartPointer * | detectSmartPointer (const Token *tok, bool withoutStd=false) const | 
| const PodType * | podtype (const std::string &name) const | 
| const PlatformType * | platform_type (const std::string &name, const std::string &platform) const | 
| std::string | getFunctionName (const Token *ftok) const | 
| Get function name for function call.  More... | |
| TypeCheck | getTypeCheck (std::string check, std::string typeName) const | 
| bool | hasAnyTypeCheck (const std::string &typeName) const | 
Static Public Member Functions | |
| static bool | isCompliantValidationExpression (const char *p) | 
| static bool | ismemory (const int id) | 
| is allocation type memory?  More... | |
| static bool | ismemory (const AllocFunc *const func) | 
| static bool | isresource (const int id) | 
| is allocation type resource?  More... | |
| static bool | isresource (const AllocFunc *const func) | 
| static bool | isContainerYield (const Token *const cond, Library::Container::Yield y, const std::string &fallback=emptyString) | 
| static Library::Container::Yield | getContainerYield (const Token *const cond) | 
Public Attributes | |
| std::map< std::string, WarnInfo > | functionwarn | 
| std::unordered_map< std::string, Container > | containers | 
| std::unordered_map< std::string, Function > | functions | 
| std::set< std::string > | defines | 
| std::unordered_map< std::string, SmartPointer > | smartPointers | 
Private Types | |
| enum class | FalseTrueMaybe { False , True , Maybe } | 
| enum | DetectContainer { ContainerOnly , IteratorOnly , Both } | 
Private Member Functions | |
| Error | loadFunction (const tinyxml2::XMLElement *const node, const std::string &name, std::set< std::string > &unknown_elements) | 
| const ArgumentChecks * | getarg (const Token *ftok, int argnr) const | 
| std::string | getFunctionName (const Token *ftok, bool &error) const | 
| const Library::Container * | detectContainerInternal (const Token *typeStart, DetectContainer detect, bool *isIterator=nullptr, bool withoutStd=false) const | 
Static Private Member Functions | |
| static const AllocFunc * | getAllocDealloc (const std::map< std::string, AllocFunc > &data, const std::string &name) | 
Private Attributes | |
| int | mAllocId {} | 
| std::set< std::string > | mFiles | 
| std::map< std::string, AllocFunc > | mAlloc | 
| std::map< std::string, AllocFunc > | mDealloc | 
| std::map< std::string, AllocFunc > | mRealloc | 
| std::unordered_map< std::string, FalseTrueMaybe > | mNoReturn | 
| std::map< std::string, std::string > | mReturnValue | 
| std::map< std::string, std::string > | mReturnValueType | 
| std::map< std::string, int > | mReturnValueContainer | 
| std::map< std::string, std::vector< MathLib::bigint > > | mUnknownReturnValues | 
| std::map< std::string, bool > | mReportErrors | 
| std::map< std::string, bool > | mProcessAfterCode | 
| std::set< std::string > | mMarkupExtensions | 
| std::map< std::string, std::set< std::string > > | mKeywords | 
| std::unordered_map< std::string, CodeBlock > | mExecutableBlocks | 
| std::map< std::string, ExportedFunctions > | mExporters | 
| std::map< std::string, std::set< std::string > > | mImporters | 
| std::map< std::string, int > | mReflection | 
| std::unordered_map< std::string, PodType > | mPodTypes | 
| std::map< std::string, PlatformType > | mPlatformTypes | 
| std::map< std::string, Platform > | mPlatforms | 
| std::map< std::pair< std::string, std::string >, TypeCheck > | mTypeChecks | 
| std::unordered_map< std::string, NonOverlappingData > | mNonOverlappingData | 
| std::unordered_set< std::string > | mEntrypoints | 
Friends | |
| class | TestSymbolDatabase | 
| class | TestSingleExecutorBase | 
| class | TestThreadExecutorBase | 
| class | TestProcessExecutorBase | 
      
  | 
  private | 
      
  | 
  strong | 
      
  | 
  strongprivate | 
      
  | 
  strong | 
      
  | 
  strong | 
      
  | 
  default | 
      
  | 
  inline | 
get allocation id for function by name (deprecated, use other alloc)
Definition at line 125 of file library.h.
References Library::AllocFunc::groupId.
      
  | 
  inline | 
Definition at line 369 of file library.h.
References Library::ArgumentChecks::minsizes.
Referenced by CheckBufferOverrun::bufferOverflow().
| const std::string & Library::blockend | ( | const std::string & | file | ) | const | 
Definition at line 1639 of file library.cpp.
References emptyString, Path::getFilenameExtensionInLowerCase(), and mExecutableBlocks.
Referenced by CheckUnusedFunctions::parseTokens().
| const std::string & Library::blockstart | ( | const std::string & | file | ) | const | 
Definition at line 1628 of file library.cpp.
References emptyString, Path::getFilenameExtensionInLowerCase(), and mExecutableBlocks.
Referenced by CheckUnusedFunctions::parseTokens().
| int Library::blockstartoffset | ( | const std::string & | file | ) | const | 
Definition at line 1616 of file library.cpp.
References Path::getFilenameExtensionInLowerCase(), and mExecutableBlocks.
Referenced by CheckUnusedFunctions::parseTokens().
      
  | 
  inline | 
get deallocation id for function by name (deprecated, use other alloc)
Definition at line 132 of file library.h.
References Library::AllocFunc::groupId.
Referenced by CheckMemoryLeak::getAllocationType(), CheckMemoryLeak::getDeallocationType(), and CheckMemoryLeak::getReallocationType().
| const Library::Container * Library::detectContainer | ( | const Token * | typeStart | ) | const | 
Definition at line 1231 of file library.cpp.
References ContainerOnly, and detectContainerInternal().
Referenced by Variable::arrayDimensions(), CheckMemoryLeakNoVar::checkForUnusedReturnValue(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckClass::checkReturnByReference(), CheckStl::if_find(), and CheckStl::negativeIndex().
      
  | 
  private | 
Definition at line 1182 of file library.cpp.
References ContainerOnly, containers, Library::Container::endPattern, isIterator(), Library::Container::itEndPattern, IteratorOnly, Token::link(), Token::Match(), Library::Container::startPattern, Library::Container::startPattern2, startsWith(), and Token::varId().
Referenced by detectContainer(), detectContainerOrIterator(), and detectIterator().
| const Library::Container * Library::detectContainerOrIterator | ( | const Token * | typeStart, | 
| bool * | isIterator = nullptr,  | 
        ||
| bool | withoutStd = false  | 
        ||
| ) | const | 
Definition at line 1241 of file library.cpp.
References Both, detectContainerInternal(), and isIterator().
Referenced by CheckMemoryLeakNoVar::checkForUnreleasedInputArgument(), CheckFunctions::checkLibraryMatchFunctions(), CheckClass::checkMemset(), CheckOther::checkMisusedScopedObject(), parsedecl(), and SymbolDatabase::setValueTypeInTokenList().
| const Library::Container * Library::detectIterator | ( | const Token * | typeStart | ) | const | 
Definition at line 1236 of file library.cpp.
References detectContainerInternal(), and IteratorOnly.
Referenced by CheckStl::stlBoundaries().
| const Library::SmartPointer * Library::detectSmartPointer | ( | const Token * | tok, | 
| bool | withoutStd = false  | 
        ||
| ) | const | 
Definition at line 1718 of file library.cpp.
References Token::Match(), Token::next(), smartPointers, and Token::str().
Referenced by SymbolDatabase::createSymbolDatabaseSetVariablePointers(), isSmartPointer(), parsedecl(), and SymbolDatabase::setValueTypeInTokenList().
| int Library::formatstr_argno | ( | const Token * | ftok | ) | const | 
Definition at line 1389 of file library.cpp.
References functions, and getFunctionName().
Referenced by CheckIO::checkWrongPrintfScanfArguments(), getArgDirection(), and CheckNullPointer::parseFunctionCall().
| bool Library::formatstr_function | ( | const Token * | ftok | ) | const | 
Definition at line 1378 of file library.cpp.
References functions, getFunctionName(), and isNotLibraryFunction().
Referenced by CheckIO::checkWrongPrintfScanfArguments(), getArgDirection(), and CheckNullPointer::parseFunctionCall().
| bool Library::formatstr_scan | ( | const Token * | ftok | ) | const | 
Definition at line 1398 of file library.cpp.
References functions, and getFunctionName().
Referenced by CheckIO::checkWrongPrintfScanfArguments(), getArgDirection(), and CheckNullPointer::parseFunctionCall().
| bool Library::formatstr_secure | ( | const Token * | ftok | ) | const | 
Definition at line 1403 of file library.cpp.
References functions, and getFunctionName().
Referenced by CheckIO::checkWrongPrintfScanfArguments().
      
  | 
  inlinestaticprivate | 
Definition at line 599 of file library.h.
Referenced by getAllocFuncInfo(), getDeallocFuncInfo(), and getReallocFuncInfo().
      
  | 
  inline | 
| const Library::AllocFunc * Library::getAllocFuncInfo | ( | const Token * | tok | ) | const | 
get allocation info for function
Definition at line 1077 of file library.cpp.
References Token::astOperand1(), Token::astOperand2(), functions, getAllocDealloc(), getFunctionName(), isNotLibraryFunction(), mAlloc, and Token::simpleMatch().
Referenced by CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckFunctions::checkIgnoredReturnValue(), CheckOther::checkInvalidFree(), CheckClass::checkMemset(), CheckUninitVar::checkScope(), CheckLeakAutoVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckSizeof::checkSizeofForPointerSize(), CheckClass::copyconstructors(), findAllocFuncCallToken(), CheckLeakAutoVar::functionCall(), getAllocId(), getOutparamAllocation(), CheckClass::hasAllocation(), CheckMemoryLeakStructMember::isMalloc(), and valueFlowDynamicBufferSize().
| int Library::getAllocId | ( | const Token * | tok, | 
| int | arg | ||
| ) | const | 
get allocation id for function
Definition at line 1104 of file library.cpp.
References Library::AllocFunc::arg, getAllocFuncInfo(), and Library::AllocFunc::groupId.
Referenced by CheckMemoryLeak::getAllocationType().
      
  | 
  private | 
Definition at line 1125 of file library.cpp.
References functions, getFunctionName(), and isNotLibraryFunction().
Referenced by getArgDirection(), isFloatArgValid(), isIntArgValid(), isnullargbad(), and isuninitargbad().
| Library::ArgumentChecks::Direction Library::getArgDirection | ( | const Token * | ftok, | 
| int | argnr | ||
| ) | const | 
Definition at line 1497 of file library.cpp.
References Library::ArgumentChecks::DIR_IN, Library::ArgumentChecks::DIR_OUT, Library::ArgumentChecks::DIR_UNKNOWN, Library::ArgumentChecks::direction, formatstr_argno(), formatstr_function(), formatstr_scan(), and getarg().
Referenced by CheckOther::checkConstPointer(), CheckUninitVar::isMemberVariableAssignment(), and isVariableChangedByFunctionCall().
      
  | 
  inline | 
Definition at line 362 of file library.h.
References Library::ArgumentChecks::IteratorInfo::it, and Library::ArgumentChecks::iteratorInfo.
Referenced by CheckStl::knownEmptyContainer(), CheckStl::mismatchingContainers(), SymbolDatabase::setValueTypeInTokenList(), and valueFlowLifetimeFunction().
| const Token * Library::getContainerFromAction | ( | const Token * | tok, | 
| Container::Action | action | ||
| ) | const | 
Definition at line 1690 of file library.cpp.
References astIsContainer(), Token::astOperand1(), Token::astOperand2(), ValueType::container, Library::Container::getAction(), getFunction(), Token::Match(), Token::previous(), Token::simpleMatch(), Token::strAt(), Token::tokAt(), and Token::valueType().
| const Token * Library::getContainerFromYield | ( | const Token * | tok, | 
| Container::Yield | yield | ||
| ) | const | 
Definition at line 1664 of file library.cpp.
References astIsContainer(), Token::astOperand1(), Token::astOperand2(), ValueType::container, Library::Container::EMPTY, getFunction(), Library::Container::getYield(), Token::Match(), Token::previous(), Token::simpleMatch(), Library::Container::SIZE, Token::strAt(), Token::tokAt(), and Token::valueType().
Referenced by ContainerConditionHandler::parse(), and programMemoryParseCondition().
      
  | 
  static | 
Definition at line 1269 of file library.cpp.
References Token::astOperand1(), Token::astOperand2(), Library::Container::NO_YIELD, Token::simpleMatch(), and Token::str().
Referenced by CheckAssert::assertWithSideEffects().
      
  | 
  inline | 
| const Library::AllocFunc * Library::getDeallocFuncInfo | ( | const Token * | tok | ) | const | 
get deallocation info for function
Definition at line 1086 of file library.cpp.
References Token::astOperand1(), Token::astOperand2(), functions, getAllocDealloc(), getFunctionName(), isNotLibraryFunction(), mDealloc, and Token::simpleMatch().
Referenced by CheckAutoVariables::autoVariables(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckOther::checkInvalidFree(), CheckLeakAutoVar::checkScope(), CheckMemoryLeakStructMember::checkStructVariable(), CheckLeakAutoVar::checkTokenInsideExpression(), CheckLeakAutoVar::functionCall(), getDeallocId(), and CheckClass::hasAllocation().
| int Library::getDeallocId | ( | const Token * | tok, | 
| int | arg | ||
| ) | const | 
get deallocation id for function
Definition at line 1111 of file library.cpp.
References Library::AllocFunc::arg, getDeallocFuncInfo(), and Library::AllocFunc::groupId.
Referenced by CheckMemoryLeak::getDeallocationType().
| const Library::Function * Library::getFunction | ( | const Token * | ftok | ) | const | 
Definition at line 1474 of file library.cpp.
References functions, getFunctionName(), and isNotLibraryFunction().
Referenced by CheckAssert::assertWithSideEffects(), astFunctionYield(), FwdAnalysis::checkRecursive(), getContainerFromAction(), getContainerFromYield(), getContainerYield(), isConstFunctionCall(), and valueFlowLifetimeFunction().
| std::string Library::getFunctionName | ( | const Token * | ftok | ) | const | 
Get function name for function call.
Definition at line 1016 of file library.cpp.
References Token::astOperand1(), Token::astOperand2(), Token::astParent(), error, Token::Match(), Token::next(), Token::previous(), Token::simpleMatch(), startsWith(), Token::str(), Token::strAt(), and Token::tokAt().
Referenced by CheckAssert::assertWithSideEffects(), CheckFunctions::checkLibraryMatchFunctions(), CheckLeakAutoVar::checkScope(), CheckLeakAutoVar::configurationInfo(), formatstr_argno(), formatstr_function(), formatstr_scan(), formatstr_secure(), CheckLeakAutoVar::functionCall(), getAllocFuncInfo(), getarg(), getDeallocFuncInfo(), getFunction(), getFunctionName(), getNonOverlappingData(), getReallocFuncInfo(), getUseRetValType(), getWarnInfo(), hasminsize(), hasNoreturnFunction(), isFunctionConst(), isnoreturn(), isNotLibraryFunction(), isnotnoreturn(), isnullargbad(), isuninitargbad(), returnValue(), returnValueContainer(), returnValueType(), and unknownReturnValues().
      
  | 
  private | 
Definition at line 969 of file library.cpp.
References astCanonicalType(), Token::astOperand1(), Token::astOperand2(), Token::astParent(), error, functions, getFunctionName(), Token::isName(), Token::Match(), matchArguments(), Token::next(), Token::originalName(), Token::scope(), Token::simpleMatch(), and Token::str().
| const Library::NonOverlappingData * Library::getNonOverlappingData | ( | const Token * | ftok | ) | const | 
Definition at line 1408 of file library.cpp.
References getFunctionName(), isNotLibraryFunction(), and mNonOverlappingData.
Referenced by CheckOther::checkOverlappingWrite().
| const Library::AllocFunc * Library::getReallocFuncInfo | ( | const Token * | tok | ) | const | 
get reallocation info for function
Definition at line 1095 of file library.cpp.
References Token::astOperand1(), Token::astOperand2(), functions, getAllocDealloc(), getFunctionName(), isNotLibraryFunction(), mRealloc, and Token::simpleMatch().
Referenced by CheckLeakAutoVar::changeAllocStatusIfRealloc(), CheckClass::checkMemset(), CheckMemoryLeakInFunction::checkReallocUsage(), CheckClass::copyconstructors(), CheckLeakAutoVar::functionCall(), CheckMemoryLeak::getReallocationType(), getReallocId(), CheckMemoryLeak::isReopenStandardStream(), and valueFlowDynamicBufferSize().
| int Library::getReallocId | ( | const Token * | tok, | 
| int | arg | ||
| ) | const | 
get reallocation id for function
Definition at line 1118 of file library.cpp.
References Library::AllocFunc::arg, getReallocFuncInfo(), and Library::AllocFunc::groupId.
Referenced by CheckMemoryLeak::getReallocationType().
| Library::TypeCheck Library::getTypeCheck | ( | std::string | check, | 
| std::string | typeName | ||
| ) | const | 
Definition at line 1751 of file library.cpp.
References def, and mTypeChecks.
Referenced by CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckFunctions::checkLibraryMatchFunctions(), CheckOther::checkMisusedScopedObject(), and CheckClass::constructors().
| Library::UseRetValType Library::getUseRetValType | ( | const Token * | ftok | ) | const | 
Definition at line 1416 of file library.cpp.
References astContainerAction(), astContainerYield(), Token::astParent(), DEFAULT, functions, getFunctionName(), isNotLibraryFunction(), Library::Container::NO_ACTION, NONE, and Token::simpleMatch().
Referenced by CheckFunctions::checkIgnoredReturnValue().
| const Library::WarnInfo * Library::getWarnInfo | ( | const Token * | ftok | ) | const | 
Definition at line 1323 of file library.cpp.
References functionwarn, getFunctionName(), and isNotLibraryFunction().
Referenced by CheckFunctions::checkProhibitedFunctions().
| bool Library::hasAnyTypeCheck | ( | const std::string & | typeName | ) | const | 
Definition at line 1757 of file library.cpp.
References mTypeChecks.
| bool Library::hasminsize | ( | const Token * | ftok | ) | const | 
Definition at line 1485 of file library.cpp.
References functions, getFunctionName(), and isNotLibraryFunction().
Referenced by CheckBufferOverrun::bufferOverflow().
| bool Library::ignorefunction | ( | const std::string & | functionName | ) | const | 
Definition at line 1513 of file library.cpp.
References functions.
Referenced by CheckClass::getVirtualFunctionCalls().
      
  | 
  inline | 
Definition at line 344 of file library.h.
References Library::ArgumentChecks::formatstr.
Referenced by checkBufferSize().
      
  | 
  inline | 
Definition at line 349 of file library.h.
References Library::ArgumentChecks::strz.
Referenced by CheckFunctions::invalidFunctionUsage().
      
  | 
  inline | 
Definition at line 336 of file library.h.
References Library::ArgumentChecks::notbool.
Referenced by CheckFunctions::invalidFunctionUsage().
      
  | 
  static | 
      
  | 
  static | 
Definition at line 1250 of file library.cpp.
References Token::astOperand1(), Token::astOperand2(), Token::previous(), Token::simpleMatch(), and Token::str().
Referenced by isOppositeCond().
      
  | 
  inline | 
Definition at line 430 of file library.h.
Referenced by CheckUnusedFunctions::analyseWholeProgram(), CheckUnusedFunctions::check(), isArrayArg(), and CheckExceptionSafety::unhandledExceptionSpecification().
| bool Library::isexecutableblock | ( | const std::string & | file, | 
| const std::string & | token | ||
| ) | const | 
Definition at line 1610 of file library.cpp.
References Path::getFilenameExtensionInLowerCase(), and mExecutableBlocks.
Referenced by CheckUnusedFunctions::parseTokens().
      
  | 
  inline | 
Definition at line 401 of file library.h.
Referenced by CheckUnusedFunctions::parseTokens().
      
  | 
  inline | 
Definition at line 406 of file library.h.
Referenced by CheckUnusedFunctions::parseTokens().
      
  | 
  inline | 
Definition at line 397 of file library.h.
Referenced by CheckUnusedFunctions::parseTokens().
| bool Library::isFloatArgValid | ( | const Token * | ftok, | 
| int | argnr, | ||
| double | argvalue | ||
| ) | const | 
Definition at line 947 of file library.cpp.
References TokenList::front(), getarg(), gettokenlistfromvalid(), Token::isCpp(), MathLib::isEqual(), MathLib::isFloat(), MathLib::isNotEqual(), Token::Match(), Token::next(), MathLib::toDoubleNumber(), MathLib::toString(), and Library::ArgumentChecks::valid.
Referenced by Token::getInvalidValue(), and isIntArgValid().
| bool Library::isFunctionConst | ( | const std::string & | functionName, | 
| bool | pure | ||
| ) | const | 
Definition at line 1534 of file library.cpp.
References functions.
Referenced by CheckClass::checkConstFunc(), CheckOther::checkConstPointer(), CheckIO::checkFileUsage(), CheckOther::checkInvalidFree(), isNonConstFunctionCall(), isSameExpression(), isSimpleExpr(), and isVariableChanged().
| bool Library::isFunctionConst | ( | const Token * | ftok | ) | const | 
Definition at line 1541 of file library.cpp.
References astContainerYield(), Token::astParent(), Token::function(), functions, getFunctionName(), isNotLibraryFunction(), and Token::simpleMatch().
| bool Library::isimporter | ( | const std::string & | file, | 
| const std::string & | importer | ||
| ) | const | 
Definition at line 1657 of file library.cpp.
References Path::getFilenameExtensionInLowerCase(), and mImporters.
Referenced by CheckUnusedFunctions::parseTokens().
| bool Library::isIntArgValid | ( | const Token * | ftok, | 
| int | argnr, | ||
| const MathLib::bigint | argvalue | ||
| ) | const | 
Definition at line 925 of file library.cpp.
References TokenList::front(), getarg(), gettokenlistfromvalid(), Token::isCpp(), isFloatArgValid(), Token::Match(), Token::next(), MathLib::toBigNumber(), and Library::ArgumentChecks::valid.
Referenced by Token::getInvalidValue(), and CheckFunctions::invalidFunctionUsage().
| bool Library::iskeyword | ( | const std::string & | file, | 
| const std::string & | keyword | ||
| ) | const | 
Definition at line 1650 of file library.cpp.
References Path::getFilenameExtensionInLowerCase(), and mKeywords.
Referenced by CheckUnusedFunctions::parseTokens().
| bool Library::isLeakIgnore | ( | const std::string & | functionName | ) | const | 
Definition at line 1527 of file library.cpp.
References functions.
Referenced by CheckMemoryLeakNoVar::checkForUnreleasedInputArgument(), CheckLeakAutoVar::checkScope(), CheckMemoryLeakStructMember::checkStructVariable(), CheckLeakAutoVar::functionCall(), and CheckMemoryLeakInClass::variable().
      
  | 
  inlinestatic | 
Definition at line 143 of file library.h.
References Library::AllocFunc::groupId.
      
  | 
  inlinestatic | 
is allocation type memory?
Definition at line 140 of file library.h.
Referenced by CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckMemoryLeak::getAllocationType(), CheckMemoryLeak::getDeallocationType(), CheckMemoryLeak::getReallocationType(), and load().
| bool Library::isnoreturn | ( | const Token * | ftok | ) | const | 
Definition at line 1558 of file library.cpp.
References astContainerAction(), astContainerYield(), Token::astParent(), Token::function(), getFunctionName(), isNotLibraryFunction(), Maybe, mNoReturn, Library::Container::NO_ACTION, Library::Container::NO_YIELD, Token::simpleMatch(), and True.
Referenced by CheckIO::checkFileUsage(), checkMissingReturnScope(), CheckOther::checkUnreachableCode(), Tokenizer::dump(), hasNoreturnFunction(), isEscaped(), isEscapedOrJump(), isEscapeFunction(), isScopeNoReturn(), and CheckOther::unreachableCodeError().
| bool Library::isNotLibraryFunction | ( | const Token * | ftok | ) | const | 
Definition at line 1286 of file library.cpp.
References Scope::eGlobal, Token::function(), getFunctionName(), Token::isKeyword(), Token::isStandardType(), matchArguments(), and Token::varId().
Referenced by CheckFunctions::checkLibraryMatchFunctions(), formatstr_function(), getAllocFuncInfo(), getarg(), getCastTypeStartToken(), getDeallocFuncInfo(), getFunction(), getNonOverlappingData(), getReallocFuncInfo(), getUseRetValType(), getWarnInfo(), hasminsize(), isFunctionConst(), isnoreturn(), isnotnoreturn(), returnValue(), returnValueContainer(), returnValueType(), setTokenValue(), and unknownReturnValues().
| bool Library::isnotnoreturn | ( | const Token * | ftok | ) | const | 
Definition at line 1579 of file library.cpp.
References False, Token::function(), getFunctionName(), isNotLibraryFunction(), Maybe, and mNoReturn.
Referenced by checkMissingReturnScope(), CheckMemoryLeakInFunction::checkReallocUsage(), and isScopeNoReturn().
| bool Library::isnullargbad | ( | const Token * | ftok, | 
| int | argnr | ||
| ) | const | 
Definition at line 1047 of file library.cpp.
References functions, getarg(), getFunctionName(), and Library::ArgumentChecks::notnull.
Referenced by getFunctionUsage(), CheckUninitVar::isFunctionParUsage(), isVariableChangedByFunctionCall(), CheckNullPointer::nullConstantDereference(), and CheckNullPointer::parseFunctionCall().
      
  | 
  inline | 
Definition at line 419 of file library.h.
Referenced by CheckUnusedFunctions::parseTokens().
      
  | 
  inlinestatic | 
Definition at line 151 of file library.h.
References Library::AllocFunc::groupId.
      
  | 
  inlinestatic | 
is allocation type resource?
Definition at line 148 of file library.h.
Referenced by CheckLeakAutoVar::doubleFreeError(), CheckLeakAutoVar::leakError(), and load().
| bool Library::isScopeNoReturn | ( | const Token * | end, | 
| std::string * | unknownFunc | ||
| ) | const | 
Definition at line 1141 of file library.cpp.
References Token::astOperand1(), Token::astTop(), Token::isKeyword(), Token::isName(), isnoreturn(), isnotnoreturn(), Token::linkAt(), Token::Match(), Token::previous(), Token::simpleMatch(), Token::str(), and Token::tokAt().
Referenced by CheckClass::checkReturnPtrThis(), isEscapeScope(), and Tokenizer::isScopeNoReturn().
| bool Library::isSmartPointer | ( | const Token * | tok | ) | const | 
Definition at line 1713 of file library.cpp.
References detectSmartPointer().
Referenced by CheckClass::checkConst(), CheckLeakAutoVar::checkScope(), Variable::evaluate(), CheckLeakAutoVar::functionCall(), SymbolDatabase::setValueType(), and SymbolDatabase::setValueTypeInTokenList().
| bool Library::isuninitargbad | ( | const Token * | ftok, | 
| int | argnr, | ||
| int | indirect = 0,  | 
        ||
| bool * | hasIndirect = nullptr  | 
        ||
| ) | const | 
Definition at line 1060 of file library.cpp.
References functions, getarg(), getFunctionName(), and Library::ArgumentChecks::notuninit.
Referenced by getFunctionUsage(), CheckUninitVar::isFunctionParUsage(), and isVariableChangedByFunctionCall().
| bool Library::isUse | ( | const std::string & | functionName | ) | const | 
Definition at line 1520 of file library.cpp.
References functions.
Referenced by CheckLeakAutoVar::checkScope().
| Library::Error Library::load | ( | const char | exename[], | 
| const char | path[] | ||
| ) | 
Definition at line 68 of file library.cpp.
References BAD_XML, endsWith(), error, Library::Error::errorcode, FILE_NOT_FOUND, Path::fromNativeSeparators(), Path::getAbsoluteFilePath(), Path::getCurrentExecutablePath(), Path::getFilenameExtension(), Path::getPathFromFilename(), mFiles, and OK.
Referenced by MainWindow::loadLibrary(), ProjectFileDialog::ProjectFileDialog(), and CmdLineParser::tryLoadLibrary().
| Library::Error Library::load | ( | const tinyxml2::XMLDocument & | doc | ) | 
Definition at line 193 of file library.cpp.
References Library::Container::actionFrom(), Library::AllocFunc::arg, Library::Container::arrayLike_indexOp, BAD_ATTRIBUTE_VALUE, BAD_XML, Library::PodType::BOOL, Library::AllocFunc::bufferSize, Library::AllocFunc::bufferSizeArg1, Library::AllocFunc::bufferSizeArg2, Library::AllocFunc::calloc, Library::PodType::CHAR, check, checkFiniteLifetime, containers, defines, DUPLICATE_DEFINE, DUPLICATE_PLATFORM_TYPE, emptyString, Library::Container::endPattern, endsWith(), Library::Error::errorcode, Library::Container::functions, functions, getnames(), Library::AllocFunc::groupId, Library::Container::hasInitializerListConstructor, Library::AllocFunc::initData, Library::PodType::INT, ismemory(), isresource(), Library::Container::itEndPattern, loadFunction(), Library::PodType::LONG, Library::PodType::LONGLONG, Library::AllocFunc::malloc, mAlloc, mAllocId, Library::PlatformType::mConstPtr, mDealloc, mEntrypoints, mExecutableBlocks, mExporters, mImporters, MISSING_ATTRIBUTE, mKeywords, Library::PlatformType::mLong, mMarkupExtensions, mPlatforms, mPlatformTypes, mPodTypes, Library::PlatformType::mPointer, mProcessAfterCode, Library::PlatformType::mPtrPtr, mRealloc, mReflection, mReportErrors, Library::PlatformType::mSigned, Library::PlatformType::mType, mTypeChecks, Library::PlatformType::mUnsigned, Library::Container::RangeItemRecordTypeItem::name, Library::SmartPointer::name, Library::PodType::NO, Library::Container::NO_ACTION, Library::Container::NO_YIELD, Library::AllocFunc::none, OK, Library::Container::opLessAllowed, platform_type(), PLATFORM_TYPE_REDEFINED, Library::Container::rangeItemRecordType, Library::AllocFunc::reallocArg, Library::PodType::SHORT, sign(), Library::PodType::sign, Library::PodType::size, Library::Container::size_templateArgNo, smartPointers, Library::Container::startPattern, Library::Container::startPattern2, Library::Container::stdAssociativeLike, Library::Container::stdStringLike, Library::PodType::stdtype, Library::AllocFunc::strdup, suppress, Library::Container::RangeItemRecordTypeItem::templateParameter, Library::Container::type_templateArgNo, Library::SmartPointer::unique, UNKNOWN_ELEMENT, Library::Container::unstableErase, Library::Container::unstableInsert, UNSUPPORTED_FORMAT, Library::Container::view, and Library::Container::yieldFrom().
      
  | 
  private | 
Definition at line 676 of file library.cpp.
References Library::Container::actionFrom(), Library::Function::argumentChecks, Library::ArgumentChecks::MinSize::ARGVALUE, BAD_ATTRIBUTE_VALUE, Standards::c, Standards::C89, Library::ArgumentChecks::IteratorInfo::container, Library::Function::containerAction, Library::Function::containerYield, Library::NonOverlappingData::countArg, Standards::cpp, Standards::CPP03, DEFAULT, Library::ArgumentChecks::DIR_IN, Library::ArgumentChecks::DIR_INOUT, Library::ArgumentChecks::DIR_OUT, Library::ArgumentChecks::direction, ERROR_CODE, False, Library::ArgumentChecks::IteratorInfo::first, Library::ArgumentChecks::formatstr, Library::Function::formatstr, Library::Function::formatstr_scan, Library::Function::formatstr_secure, functions, functionwarn, getnames(), Library::Function::ignore, isCompliantValidationExpression(), Library::Function::isconst, Library::Function::ispure, Library::ArgumentChecks::IteratorInfo::it, Library::ArgumentChecks::iteratorInfo, Library::ArgumentChecks::IteratorInfo::last, Library::Function::leakignore, Maybe, Library::WarnInfo::message, Library::ArgumentChecks::minsizes, MISSING_ATTRIBUTE, mNonOverlappingData, mNoReturn, mReturnValue, mReturnValueContainer, mReturnValueType, Library::ArgumentChecks::MinSize::MUL, mUnknownReturnValues, Library::Container::NO_ACTION, Library::Container::NO_YIELD, Library::ArgumentChecks::notbool, Library::ArgumentChecks::notnull, Library::ArgumentChecks::notuninit, OK, Library::ArgumentChecks::optional, Library::NonOverlappingData::ptr1Arg, Library::NonOverlappingData::ptr2Arg, Library::Function::returnType, Standards::setC(), Standards::setCPP(), Library::WarnInfo::severity, severityFromString(), Library::NonOverlappingData::sizeArg, Library::ArgumentChecks::MinSize::SIZEOF, Library::WarnInfo::standards, Library::ArgumentChecks::MinSize::STRLEN, Library::NonOverlappingData::strlenArg, Library::ArgumentChecks::strz, True, unknownReturnValues(), Library::Function::useretval, Library::ArgumentChecks::valid, Library::ArgumentChecks::MinSize::VALUE, Library::ArgumentChecks::variadic, and Library::Container::yieldFrom().
Referenced by load().
      
  | 
  inline | 
Definition at line 380 of file library.h.
Referenced by CmdLineParser::fillSettingsFromArgs().
| bool Library::markupFile | ( | const std::string & | path | ) | const | 
Definition at line 1593 of file library.cpp.
References Path::getFilenameExtensionInLowerCase(), and mMarkupExtensions.
Referenced by CppCheck::checkFile(), CheckUnusedFunctions::parseTokens(), and Tokenizer::simplifyTokenList1().
| bool Library::matchArguments | ( | const Token * | ftok, | 
| const std::string & | functionName | ||
| ) | const | 
Definition at line 1301 of file library.cpp.
References functions, and numberOfArgumentsWithoutAst().
Referenced by getFunctionName(), and isNotLibraryFunction().
      
  | 
  inline | 
Definition at line 485 of file library.h.
Referenced by ValueType::fromLibraryType(), and load().
      
  | 
  inline | 
Definition at line 450 of file library.h.
Referenced by CheckMemoryLeakNoVar::checkForUnreleasedInputArgument(), CheckFunctions::checkLibraryMatchFunctions(), CheckClass::checkMemsetType(), CheckClass::constructors(), Variable::evaluate(), ValueType::fromLibraryType(), CheckIO::ArgumentInfo::isLibraryType(), and Tokenizer::sizeOfType().
| bool Library::processMarkupAfterCode | ( | const std::string & | path | ) | const | 
Definition at line 1598 of file library.cpp.
References Path::getFilenameExtensionInLowerCase(), and mProcessAfterCode.
      
  | 
  inline | 
Definition at line 423 of file library.h.
Referenced by CheckUnusedFunctions::parseTokens().
| bool Library::reportErrors | ( | const std::string & | path | ) | const | 
Definition at line 1604 of file library.cpp.
References Path::getFilenameExtensionInLowerCase(), and mReportErrors.
Referenced by Executor::hasToLog(), and CppCheck::reportErr().
| const std::string & Library::returnValue | ( | const Token * | ftok | ) | const | 
Definition at line 1436 of file library.cpp.
References emptyString, getFunctionName(), isNotLibraryFunction(), and mReturnValue.
Referenced by CheckLeakAutoVar::checkTokenInsideExpression(), createTokenFromExpression(), valueFlowLifetimeFunction(), and valueFlowSubFunction().
| int Library::returnValueContainer | ( | const Token * | ftok | ) | const | 
Definition at line 1458 of file library.cpp.
References getFunctionName(), isNotLibraryFunction(), and mReturnValueContainer.
Referenced by valueFlowLifetimeFunction().
| const std::string & Library::returnValueType | ( | const Token * | ftok | ) | const | 
Definition at line 1444 of file library.cpp.
References Token::astParent(), ValueType::container, emptyString, getFunctionName(), Library::Container::getReturnType(), isNotLibraryFunction(), mReturnValueType, Token::simpleMatch(), Token::str(), and Token::valueType().
Referenced by CheckOther::checkInnerScope(), isTemporary(), SymbolDatabase::setValueTypeInTokenList(), and valueFlowUnknownFunctionReturn().
| std::vector< MathLib::bigint > Library::unknownReturnValues | ( | const Token * | ftok | ) | const | 
Definition at line 1466 of file library.cpp.
References getFunctionName(), isNotLibraryFunction(), and mUnknownReturnValues.
Referenced by loadFunction(), and valueFlowUnknownFunctionReturn().
      
  | 
  inline | 
Definition at line 357 of file library.h.
References emptyString, and Library::ArgumentChecks::valid.
Referenced by CheckFunctions::invalidFunctionUsage().
| std::unordered_map<std::string, Container> Library::containers | 
Definition at line 270 of file library.h.
Referenced by detectContainerInternal(), and load().
| std::set<std::string> Library::defines | 
Definition at line 434 of file library.h.
Referenced by createDUI(), and load().
| std::unordered_map<std::string, Function> Library::functions | 
Definition at line 330 of file library.h.
Referenced by CheckFunctions::checkLibraryMatchFunctions(), SymbolDatabase::createSymbolDatabaseIncompleteVars(), formatstr_argno(), formatstr_function(), formatstr_scan(), formatstr_secure(), getAllocFuncInfo(), getarg(), getDeallocFuncInfo(), getFunction(), getFunctionName(), getReallocFuncInfo(), getUseRetValType(), hasminsize(), hasNoreturnFunction(), ignorefunction(), isFunctionConst(), isLeakIgnore(), isnullargbad(), isuninitargbad(), isUse(), load(), loadFunction(), and matchArguments().
| std::map<std::string, WarnInfo> Library::functionwarn | 
Definition at line 174 of file library.h.
Referenced by CheckFunctions::getErrorMessages(), getWarnInfo(), and loadFunction().
      
  | 
  private | 
Definition at line 572 of file library.h.
Referenced by getAllocFuncInfo(), and load().
      
  | 
  private | 
Definition at line 573 of file library.h.
Referenced by getDeallocFuncInfo(), and load().
      
  | 
  private | 
      
  | 
  private | 
Definition at line 584 of file library.h.
Referenced by blockend(), blockstart(), blockstartoffset(), isexecutableblock(), and load().
      
  | 
  private | 
      
  | 
  private | 
      
  | 
  private | 
Definition at line 586 of file library.h.
Referenced by isimporter(), and load().
      
  | 
  private | 
Definition at line 583 of file library.h.
Referenced by iskeyword(), and load().
      
  | 
  private | 
Definition at line 582 of file library.h.
Referenced by load(), and markupFile().
      
  | 
  private | 
Definition at line 592 of file library.h.
Referenced by getNonOverlappingData(), and loadFunction().
      
  | 
  private | 
Definition at line 575 of file library.h.
Referenced by isnoreturn(), isnotnoreturn(), and loadFunction().
      
  | 
  private | 
      
  | 
  private | 
      
  | 
  private | 
      
  | 
  private | 
Definition at line 581 of file library.h.
Referenced by load(), and processMarkupAfterCode().
      
  | 
  private | 
Definition at line 574 of file library.h.
Referenced by getReallocFuncInfo(), and load().
      
  | 
  private | 
      
  | 
  private | 
Definition at line 580 of file library.h.
Referenced by load(), and reportErrors().
      
  | 
  private | 
Definition at line 576 of file library.h.
Referenced by loadFunction(), and returnValue().
      
  | 
  private | 
Definition at line 578 of file library.h.
Referenced by loadFunction(), and returnValueContainer().
      
  | 
  private | 
Definition at line 577 of file library.h.
Referenced by loadFunction(), and returnValueType().
      
  | 
  private | 
Definition at line 591 of file library.h.
Referenced by getTypeCheck(), hasAnyTypeCheck(), and load().
      
  | 
  private | 
Definition at line 579 of file library.h.
Referenced by loadFunction(), and unknownReturnValues().
| std::unordered_map<std::string, SmartPointer> Library::smartPointers | 
Definition at line 441 of file library.h.
Referenced by detectSmartPointer(), load(), and SymbolDatabase::setValueTypeInTokenList().