doxygen: some updates to the lib/checkother
This commit is contained in:
parent
5ea7e32bf9
commit
45987e5e9f
|
@ -95,56 +95,62 @@ public:
|
||||||
*/
|
*/
|
||||||
static void analyseFunctions(const Token * const tokens, std::set<std::string> &func);
|
static void analyseFunctions(const Token * const tokens, std::set<std::string> &func);
|
||||||
|
|
||||||
/** @brief %Check: Are there C-style pointer casts in a c++ file? */
|
/** @brief Are there C-style pointer casts in a c++ file? */
|
||||||
void warningOldStylePointerCast();
|
void warningOldStylePointerCast();
|
||||||
|
|
||||||
// Redundant code
|
/** @brief Redundant code: if (p) delete p; */
|
||||||
void warningRedundantCode();
|
void warningRedundantCode();
|
||||||
|
|
||||||
// Invalid function usage..
|
/**
|
||||||
|
* @brief Invalid function usage (invalid radix / overlapping data)
|
||||||
|
*
|
||||||
|
* %Check that given function parameters are valid according to the standard
|
||||||
|
* - wrong radix given for strtol/strtoul
|
||||||
|
* - overlapping data when using sprintf/snprintf
|
||||||
|
*/
|
||||||
void invalidFunctionUsage();
|
void invalidFunctionUsage();
|
||||||
|
|
||||||
// Check for unsigned division that might create bad results
|
/** @brief %Check for unsigned division */
|
||||||
void checkUnsignedDivision();
|
void checkUnsignedDivision();
|
||||||
|
|
||||||
/** Check for unreachable code */
|
/** @brief %Check for unreachable code */
|
||||||
void unreachableCode();
|
void unreachableCode();
|
||||||
void unreachableCodeError(const Token *tok);
|
void unreachableCodeError(const Token *tok);
|
||||||
|
|
||||||
/** Check for unused function variables */
|
/** @brief %Check for unused function variables */
|
||||||
void functionVariableUsage();
|
void functionVariableUsage();
|
||||||
void unusedVariableError(const Token *tok, const std::string &varname);
|
void unusedVariableError(const Token *tok, const std::string &varname);
|
||||||
void unreadVariableError(const Token *tok, const std::string &varname);
|
void unreadVariableError(const Token *tok, const std::string &varname);
|
||||||
void unassignedVariableError(const Token *tok, const std::string &varname);
|
void unassignedVariableError(const Token *tok, const std::string &varname);
|
||||||
|
|
||||||
// Check scope of variables
|
/** @brief %Check scope of variables */
|
||||||
void checkVariableScope();
|
void checkVariableScope();
|
||||||
|
|
||||||
// Check for constant function parameter
|
/** @brief %Check for constant function parameter */
|
||||||
void checkConstantFunctionParameter();
|
void checkConstantFunctionParameter();
|
||||||
|
|
||||||
// Check that all struct members are used
|
/** @brief %Check that all struct members are used */
|
||||||
void checkStructMemberUsage();
|
void checkStructMemberUsage();
|
||||||
|
|
||||||
// Using char variable as array index / as operand in bit operation
|
/** @brief Using char variable as array index / as operand in bit operation */
|
||||||
void checkCharVariable();
|
void checkCharVariable();
|
||||||
|
|
||||||
// Incomplete statement. A statement that only contains a constant or variable
|
/** @brief Incomplete statement. A statement that only contains a constant or variable */
|
||||||
void checkIncompleteStatement();
|
void checkIncompleteStatement();
|
||||||
|
|
||||||
/** str plus char */
|
/** @brief str plus char (unusual pointer arithmetic) */
|
||||||
void strPlusChar();
|
void strPlusChar();
|
||||||
|
|
||||||
/** possible null pointer dereference */
|
/** @brief possible null pointer dereference */
|
||||||
void nullPointer();
|
void nullPointer();
|
||||||
|
|
||||||
/** new type of check: check execution paths */
|
/** @brief new type of check: check execution paths */
|
||||||
void executionPaths();
|
void executionPaths();
|
||||||
|
|
||||||
/** Check zero division*/
|
/** @brief %Check zero division*/
|
||||||
void checkZeroDivision();
|
void checkZeroDivision();
|
||||||
|
|
||||||
/** Check for post increment/decrement in for loop*/
|
/** @brief %Check for post increment/decrement in for loop*/
|
||||||
void postIncrement();
|
void postIncrement();
|
||||||
|
|
||||||
void lookupVar(const Token *tok1, const std::string &varname);
|
void lookupVar(const Token *tok1, const std::string &varname);
|
||||||
|
@ -245,34 +251,34 @@ public:
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Does one part of the check for nullPointer().
|
* @brief Does one part of the check for nullPointer().
|
||||||
* Locate insufficient null-pointer handling after loop
|
* Locate insufficient null-pointer handling after loop
|
||||||
*/
|
*/
|
||||||
void nullPointerAfterLoop();
|
void nullPointerAfterLoop();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Does one part of the check for nullPointer().
|
* @brief Does one part of the check for nullPointer().
|
||||||
* looping through items in a linked list in a inner loop..
|
* looping through items in a linked list in a inner loop..
|
||||||
*/
|
*/
|
||||||
void nullPointerLinkedList();
|
void nullPointerLinkedList();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Does one part of the check for nullPointer().
|
* @brief Does one part of the check for nullPointer().
|
||||||
* Dereferencing a struct pointer and then checking if it's NULL..
|
* Dereferencing a struct pointer and then checking if it's NULL..
|
||||||
*/
|
*/
|
||||||
void nullPointerStructByDeRefAndChec();
|
void nullPointerStructByDeRefAndChec();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Does one part of the check for nullPointer().
|
* @brief Does one part of the check for nullPointer().
|
||||||
* Dereferencing a pointer and then checking if it's NULL..
|
* Dereferencing a pointer and then checking if it's NULL..
|
||||||
*/
|
*/
|
||||||
void nullPointerByDeRefAndChec();
|
void nullPointerByDeRefAndChec();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Does one part of the check for nullPointer().
|
* @brief Does one part of the check for nullPointer().
|
||||||
* 1. initialize pointer to 0
|
* -# initialize pointer to 0
|
||||||
* 2. conditionally assign pointer
|
* -# conditionally assign pointer
|
||||||
* 3. dereference pointer
|
* -# dereference pointer
|
||||||
*/
|
*/
|
||||||
void nullPointerConditionalAssignment();
|
void nullPointerConditionalAssignment();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue