Cppcheck
Functions | Variables
checkother.cpp File Reference
#include "checkother.h"
#include "astutils.h"
#include "fwdanalysis.h"
#include "library.h"
#include "mathlib.h"
#include "platform.h"
#include "settings.h"
#include "standards.h"
#include "symboldatabase.h"
#include "token.h"
#include "tokenize.h"
#include "tokenlist.h"
#include "utils.h"
#include "valueflow.h"
#include "vfvalue.h"
#include <algorithm>
#include <cctype>
#include <list>
#include <map>
#include <set>
#include <sstream>
#include <utility>

Go to the source code of this file.

Functions

static bool isFunctionOrBreakPattern (const Token *tok)
 
static bool isSimpleExpr (const Token *tok, const Variable *var, const Settings &settings)
 
static bool isVariableMutableInInitializer (const Token *start, const Token *end, nonneg int varid)
 
static const TokengetVariableChangedStart (const Variable *p)
 
static bool isType (const Token *tok, bool unknown)
 
static bool isVarDeclOp (const Token *tok)
 
static bool isBracketAccess (const Token *tok)
 
static bool isConstant (const Token *tok)
 
static bool isConstStatement (const Token *tok, bool isNestedBracket=false)
 
static bool isVoidStmt (const Token *tok)
 
static bool isConstTop (const Token *tok)
 
static const TokengetSingleExpressionInBlock (const Token *tok)
 
static bool constructorTakesReference (const Scope *const classScope)
 
static bool isNegative (const Token *tok, const Settings &settings)
 
static const TokenfindShadowed (const Scope *scope, const Variable &var, int linenr)
 
static bool isVariableExpression (const Token *tok)
 
static bool isVariableExprHidden (const Token *tok)
 
static bool getBufAndOffset (const Token *expr, const Token *&buf, MathLib::bigint *offset, const Settings &settings, MathLib::bigint *sizeValue=nullptr)
 

Variables

static const CWE CWE128 (128U)
 
static const CWE CWE131 (131U)
 
static const CWE CWE197 (197U)
 
static const CWE CWE362 (362U)
 
static const CWE CWE369 (369U)
 
static const CWE CWE398 (398U)
 
static const CWE CWE475 (475U)
 
static const CWE CWE561 (561U)
 
static const CWE CWE563 (563U)
 
static const CWE CWE570 (570U)
 
static const CWE CWE571 (571U)
 
static const CWE CWE672 (672U)
 
static const CWE CWE628 (628U)
 
static const CWE CWE683 (683U)
 
static const CWE CWE704 (704U)
 
static const CWE CWE758 (758U)
 
static const CWE CWE768 (768U)
 
static const CWE CWE783 (783U)
 

Function Documentation

◆ constructorTakesReference()

static bool constructorTakesReference ( const Scope *const  classScope)
static

Definition at line 2825 of file checkother.cpp.

References Scope::functionList.

Referenced by CheckOther::checkRedundantCopy().

◆ findShadowed()

static const Token* findShadowed ( const Scope scope,
const Variable var,
int  linenr 
)
static

◆ getBufAndOffset()

static bool getBufAndOffset ( const Token expr,
const Token *&  buf,
MathLib::bigint offset,
const Settings settings,
MathLib::bigint sizeValue = nullptr 
)
static

◆ getSingleExpressionInBlock()

static const Token* getSingleExpressionInBlock ( const Token tok)
static

◆ getVariableChangedStart()

static const Token* getVariableChangedStart ( const Variable p)
static

◆ isBracketAccess()

static bool isBracketAccess ( const Token tok)
static

◆ isConstant()

static bool isConstant ( const Token tok)
static

Definition at line 1791 of file checkother.cpp.

References Token::isEnumerator(), and Token::Match().

Referenced by CheckOther::constStatementError(), and isConstStatement().

◆ isConstStatement()

static bool isConstStatement ( const Token tok,
bool  isNestedBracket = false 
)
static

◆ isConstTop()

static bool isConstTop ( const Token tok)
static

◆ isFunctionOrBreakPattern()

static bool isFunctionOrBreakPattern ( const Token tok)
inlinestatic

Definition at line 591 of file checkother.cpp.

References Token::Match().

Referenced by CheckOther::redundantBitwiseOperationInSwitchError().

◆ isNegative()

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

◆ isSimpleExpr()

static bool isSimpleExpr ( const Token tok,
const Variable var,
const Settings settings 
)
static

◆ isType()

static bool isType ( const Token tok,
bool  unknown 
)
static

◆ isVarDeclOp()

static bool isVarDeclOp ( const Token tok)
static

◆ isVariableExpression()

static bool isVariableExpression ( const Token tok)
static

◆ isVariableExprHidden()

static bool isVariableExprHidden ( const Token tok)
static

◆ isVariableMutableInInitializer()

static bool isVariableMutableInInitializer ( const Token start,
const Token end,
nonneg int  varid 
)
static

◆ isVoidStmt()

static bool isVoidStmt ( const Token tok)
static

Variable Documentation

◆ CWE128

const CWE CWE128(128U) ( 128U  )
static

◆ CWE131

const CWE CWE131(131U) ( 131U  )
static

◆ CWE197

const CWE CWE197(197U) ( 197U  )
static

◆ CWE362

const CWE CWE362(362U) ( 362U  )
static

◆ CWE369

const CWE CWE369(369U) ( 369U  )
static

◆ CWE398

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

◆ CWE475

const CWE CWE475(475U) ( 475U  )
static

◆ CWE561

const CWE CWE561(561U) ( 561U  )
static

◆ CWE563

const CWE CWE563(563U) ( 563U  )
static

◆ CWE570

const CWE CWE570(570U) ( 570U  )
static

◆ CWE571

const CWE CWE571(571U) ( 571U  )
static

◆ CWE628

const CWE CWE628(628U) ( 628U  )
static

◆ CWE672

const CWE CWE672(672U) ( 672U  )
static

◆ CWE683

const CWE CWE683(683U) ( 683U  )
static

◆ CWE704

const CWE CWE704(704U) ( 704U  )
static

◆ CWE758

const CWE CWE758(758U) ( 758U  )
static

◆ CWE768

const CWE CWE768(768U) ( 768U  )
static

◆ CWE783

const CWE CWE783(783U) ( 783U  )
static