diff --git a/lib/check.h b/lib/check.h index e787ff1f3..4436d2e3d 100644 --- a/lib/check.h +++ b/lib/check.h @@ -69,13 +69,21 @@ public: * @param tokens The tokens to analyse * @param result container where results are stored */ - virtual void analyse(const Token * /*tokens*/, std::set & /*result*/) const + virtual void analyse(const Token *tokens, std::set &result) const { + // suppress compiler warnings + (void)tokens; + (void)result; } - /** Save analysis data - the caller ensures thread safety */ - virtual void saveAnalysisData(const std::set & /*data*/) const + /** + * Save analysis data - the caller ensures thread safety + * @param data The data where the results are saved + */ + virtual void saveAnalysisData(const std::set &data) const { + // suppress compiler warnings + (void)data; } /** run checks, the token list is not simplified */ diff --git a/lib/checkbufferoverrun.cpp b/lib/checkbufferoverrun.cpp index cb6ca2c37..58dceef76 100644 --- a/lib/checkbufferoverrun.cpp +++ b/lib/checkbufferoverrun.cpp @@ -338,7 +338,7 @@ static bool for3(const Token * const tok, /** * Check is the counter variable increased elsewhere inside the loop or used * for anything else except reading - * \param tok first token of for-body + * \param tok1 first token of for-body * \param varid counter variable id * \return bailout needed => true */ @@ -1737,20 +1737,20 @@ public: } private: - /** Copy this check */ + /** @brief Copy this check. Called from the ExecutionPath baseclass. */ ExecutionPath *copy() { return new ExecutionPathBufferOverrun(*this); } - /** is other execution path equal? */ + /** @brief is other execution path equal? */ bool is_equal(const ExecutionPath *e) const { const ExecutionPathBufferOverrun *c = static_cast(e); return (value == c->value); } - /** @brief buffer information */ + /** @brief Buffer information */ const std::map &arrayInfo; /** no implementation => compiler error if used by accident */ @@ -1766,9 +1766,15 @@ private: value = 0; } + /** @brief Variable value. */ unsigned int value; - /** @brief Assign value to a variable */ + /** + * @brief Assign value to a variable + * @param checks the execution paths + * @param varid the variable id + * @param value the assigned value + */ static void assign_value(std::list &checks, unsigned int varid, const std::string &value) { if (varid == 0) @@ -1783,7 +1789,13 @@ private: } } - /** @brief Found array usage.. */ + /** + * @brief Found array usage, analyse the array usage + * @param tok token where usage occurs (only used when reporting the error) + * @param checks The execution paths + * @param varid1 variable id for the array + * @param varid2 variable id for the index + */ static void array_index(const Token *tok, std::list &checks, unsigned int varid1, unsigned int varid2) { if (checks.empty() || varid1 == 0 || varid2 == 0) diff --git a/lib/checkother.h b/lib/checkother.h index f9372e9f5..83ef03981 100644 --- a/lib/checkother.h +++ b/lib/checkother.h @@ -91,7 +91,6 @@ public: * @brief Uninitialized variables: analyse functions to see how they work with uninitialized variables * @param tokens [in] the token list * @param func [out] names of functions that don't handle uninitialized variables well. the function names are added to the set. No clearing is made. - * @param showAll [in] enable --all checking */ void analyse(const Token * tokens, std::set &func) const; diff --git a/lib/executionpath.h b/lib/executionpath.h index db2f228a8..9ff112864 100644 --- a/lib/executionpath.h +++ b/lib/executionpath.h @@ -99,7 +99,6 @@ public: /** * Parse tokens at given location * @param tok token to parse - * @param foundError If an error is found this is set to true * @param checks The execution paths. All execution paths in the list are executed in the current scope. * @return the token before the "next" token. **/ diff --git a/lib/token.h b/lib/token.h index d9e69c260..ac7ba93c8 100644 --- a/lib/token.h +++ b/lib/token.h @@ -287,7 +287,7 @@ public: /** * Create link to given token - * @param link The token where this token should link + * @param linkToToken The token where this token should link * to. */ void link(Token *linkToToken)