Cppcheck
Functions | Variables
checkautovariables.cpp File Reference
#include "checkautovariables.h"
#include "astutils.h"
#include "library.h"
#include "settings.h"
#include "symboldatabase.h"
#include "token.h"
#include "tokenize.h"
#include "valueflow.h"
#include "vfvalue.h"
#include <algorithm>
#include <list>
#include <unordered_set>
#include <utility>
#include <vector>

Go to the source code of this file.

Functions

static bool isPtrArg (const Token *tok)
 
static bool isArrayArg (const Token *tok, const Settings &settings)
 
static bool isArrayVar (const Token *tok)
 
static bool isRefPtrArg (const Token *tok)
 
static bool isNonReferenceArg (const Token *tok)
 
static bool isAutoVar (const Token *tok)
 
static bool isAutoVarArray (const Token *tok)
 
static bool isLocalContainerBuffer (const Token *tok)
 
static bool isAddressOfLocalVariable (const Token *expr)
 
static bool variableIsUsedInScope (const Token *start, nonneg int varId, const Scope *scope)
 
static bool isAutoVariableRHS (const Token *tok)
 
static bool hasOverloadedAssignment (const Token *tok, bool &inconclusive)
 
static bool isInScope (const Token *tok, const Scope *scope)
 
static bool isDeadScope (const Token *tok, const Scope *scope)
 
static int getPointerDepth (const Token *tok)
 
static bool isDeadTemporary (const Token *tok, const Token *expr, const Library *library)
 
static bool isEscapedReference (const Variable *var)
 
static bool isDanglingSubFunction (const Token *tokvalue, const Token *tok)
 
static const VariablegetParentVar (const Token *tok)
 
static bool isAssignedToNonLocal (const Token *tok)
 

Variables

static const CWE CWE398 (398U)
 
static const CWE CWE562 (562U)
 
static const CWE CWE590 (590U)
 

Function Documentation

◆ getParentVar()

static const Variable* getParentVar ( const Token tok)
static

◆ getPointerDepth()

static int getPointerDepth ( const Token tok)
static

◆ hasOverloadedAssignment()

static bool hasOverloadedAssignment ( const Token tok,
bool &  inconclusive 
)
static

◆ isAddressOfLocalVariable()

static bool isAddressOfLocalVariable ( const Token expr)
static

◆ isArrayArg()

static bool isArrayArg ( const Token tok,
const Settings settings 
)
static

◆ isArrayVar()

static bool isArrayVar ( const Token tok)
static

◆ isAssignedToNonLocal()

static bool isAssignedToNonLocal ( const Token tok)
static

◆ isAutoVar()

static bool isAutoVar ( const Token tok)
static

◆ isAutoVarArray()

static bool isAutoVarArray ( const Token tok)
static

◆ isAutoVariableRHS()

static bool isAutoVariableRHS ( const Token tok)
static

◆ isDanglingSubFunction()

static bool isDanglingSubFunction ( const Token tokvalue,
const Token tok 
)
static

◆ isDeadScope()

static bool isDeadScope ( const Token tok,
const Scope scope 
)
static

◆ isDeadTemporary()

static bool isDeadTemporary ( const Token tok,
const Token expr,
const Library library 
)
static

◆ isEscapedReference()

static bool isEscapedReference ( const Variable var)
static

◆ isInScope()

static bool isInScope ( const Token tok,
const Scope scope 
)
static

◆ isLocalContainerBuffer()

static bool isLocalContainerBuffer ( const Token tok)
static

◆ isNonReferenceArg()

static bool isNonReferenceArg ( const Token tok)
static

◆ isPtrArg()

static bool isPtrArg ( const Token tok)
static

◆ isRefPtrArg()

static bool isRefPtrArg ( const Token tok)
static

◆ variableIsUsedInScope()

static bool variableIsUsedInScope ( const Token start,
nonneg int  varId,
const Scope scope 
)
static

Variable Documentation

◆ CWE398

const CWE CWE398(398U) ( 398U  )
static

◆ CWE562

const CWE CWE562(562U) ( 562U  )
static

◆ CWE590

const CWE CWE590(590U) ( 590U  )
static