Cppcheck
Public Member Functions | Private Member Functions | Static Private Member Functions | Friends | List of all members
Check64BitPortability Class Reference

Check for 64-bit portability issues. More...

#include <check64bit.h>

Inheritance diagram for Check64BitPortability:
Check

Public Member Functions

 Check64BitPortability ()
 This constructor is used when registering the Check64BitPortability. More...
 
- Public Member Functions inherited from Check
 Check (const std::string &aname)
 This constructor is used when registering the CheckClass. More...
 
virtual ~Check ()
 
 Check (const Check &)=delete
 
Checkoperator= (const Check &)=delete
 
const std::string & name () const
 class name, used to generate documentation More...
 
virtual FileInfogetFileInfo (const Tokenizer &, const Settings &) const
 
virtual FileInfoloadFileInfoFromXml (const tinyxml2::XMLElement *xmlElement) const
 
virtual bool analyseWholeProgram (const CTU::FileInfo *ctu, const std::list< FileInfo * > &fileInfo, const Settings &, ErrorLogger &)
 

Private Member Functions

 Check64BitPortability (const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger)
 This constructor is used when running checks. More...
 
void runChecks (const Tokenizer &tokenizer, ErrorLogger *errorLogger) override
 Run checks against the normal token list. More...
 
void pointerassignment ()
 Check for pointer assignment. More...
 
void assignmentAddressToIntegerError (const Token *tok)
 
void assignmentIntegerToAddressError (const Token *tok)
 
void returnIntegerError (const Token *tok)
 
void returnPointerError (const Token *tok)
 
void getErrorMessages (ErrorLogger *errorLogger, const Settings *settings) const override
 get error messages More...
 
std::string classInfo () const override
 get information about this class, used to generate documentation More...
 

Static Private Member Functions

static std::string myName ()
 

Friends

class Test64BitPortability
 

Additional Inherited Members

- Static Public Member Functions inherited from Check
static std::list< Check * > & instances ()
 List of registered check classes. More...
 
static void writeToErrorList (const ErrorMessage &errmsg)
 Write given error to stdout in xml format. More...
 
- Protected Member Functions inherited from Check
 Check (std::string aname, const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger)
 This constructor is used when running checks. More...
 
void reportError (const Token *tok, const Severity severity, const std::string &id, const std::string &msg)
 report an error More...
 
void reportError (const Token *tok, const Severity severity, const std::string &id, const std::string &msg, const CWE &cwe, Certainty certainty)
 report an error More...
 
void reportError (const std::list< const Token * > &callstack, Severity severity, const std::string &id, const std::string &msg)
 report an error More...
 
void reportError (const std::list< const Token * > &callstack, Severity severity, const std::string &id, const std::string &msg, const CWE &cwe, Certainty certainty)
 report an error More...
 
void reportError (const ErrorPath &errorPath, Severity severity, const char id[], const std::string &msg, const CWE &cwe, Certainty certainty)
 
void logChecker (const char id[])
 log checker More...
 
ErrorPath getErrorPath (const Token *errtok, const ValueFlow::Value *value, std::string bug) const
 
bool wrongData (const Token *tok, const char *str)
 Use WRONG_DATA in checkers when you check for wrong data. More...
 
- Static Protected Member Functions inherited from Check
static std::string getMessageId (const ValueFlow::Value &value, const char id[])
 
- Protected Attributes inherited from Check
const Tokenizer *const mTokenizer {}
 
const Settings *const mSettings {}
 
ErrorLogger *const mErrorLogger {}
 

Detailed Description

Check for 64-bit portability issues.

Definition at line 43 of file check64bit.h.

Constructor & Destructor Documentation

◆ Check64BitPortability() [1/2]

Check64BitPortability::Check64BitPortability ( )
inline

This constructor is used when registering the Check64BitPortability.

Definition at line 48 of file check64bit.h.

◆ Check64BitPortability() [2/2]

Check64BitPortability::Check64BitPortability ( const Tokenizer tokenizer,
const Settings settings,
ErrorLogger errorLogger 
)
inlineprivate

This constructor is used when running checks.

Definition at line 52 of file check64bit.h.

Member Function Documentation

◆ assignmentAddressToIntegerError()

void Check64BitPortability::assignmentAddressToIntegerError ( const Token tok)
private

Definition at line 121 of file check64bit.cpp.

References CWE758, normal, portability, and Check::reportError().

Referenced by getErrorMessages(), and pointerassignment().

◆ assignmentIntegerToAddressError()

void Check64BitPortability::assignmentIntegerToAddressError ( const Token tok)
private

Definition at line 132 of file check64bit.cpp.

References CWE758, normal, portability, and Check::reportError().

Referenced by getErrorMessages(), and pointerassignment().

◆ classInfo()

std::string Check64BitPortability::classInfo ( ) const
inlineoverrideprivatevirtual

get information about this class, used to generate documentation

Implements Check.

Definition at line 81 of file check64bit.h.

◆ getErrorMessages()

void Check64BitPortability::getErrorMessages ( ErrorLogger errorLogger,
const Settings settings 
) const
inlineoverrideprivatevirtual

get error messages

Implements Check.

Definition at line 69 of file check64bit.h.

References assignmentAddressToIntegerError(), assignmentIntegerToAddressError(), returnIntegerError(), and returnPointerError().

◆ myName()

static std::string Check64BitPortability::myName ( )
inlinestaticprivate

Definition at line 77 of file check64bit.h.

◆ pointerassignment()

void Check64BitPortability::pointerassignment ( )
private

◆ returnIntegerError()

void Check64BitPortability::returnIntegerError ( const Token tok)
private

Definition at line 154 of file check64bit.cpp.

References CWE758, normal, portability, and Check::reportError().

Referenced by getErrorMessages(), and pointerassignment().

◆ returnPointerError()

void Check64BitPortability::returnPointerError ( const Token tok)
private

Definition at line 143 of file check64bit.cpp.

References CWE758, normal, portability, and Check::reportError().

Referenced by getErrorMessages(), and pointerassignment().

◆ runChecks()

void Check64BitPortability::runChecks ( const Tokenizer tokenizer,
ErrorLogger errorLogger 
)
inlineoverrideprivatevirtual

Run checks against the normal token list.

Implements Check.

Definition at line 56 of file check64bit.h.

References Tokenizer::getSettings(), and pointerassignment().

Friends And Related Function Documentation

◆ Test64BitPortability

friend class Test64BitPortability
friend

Definition at line 44 of file check64bit.h.


The documentation for this class was generated from the following files: