From 6aea2faacd2e93ed5cb53f9c8ad3d05c20ebc21d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 4 Oct 2009 13:46:37 +0200 Subject: [PATCH] doc: refactoring of the docs for CheckOther --- src/checkother.h | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/src/checkother.h b/src/checkother.h index 6bbecdf58..a3428b6eb 100644 --- a/src/checkother.h +++ b/src/checkother.h @@ -147,12 +147,17 @@ public: void getErrorMessages() { + // error + sprintfOverlappingDataError(0, "varname"); + udivError(0); + nullPointerError(0, "pointer"); + zerodivError(0); + + // style cstyleCastError(0); redundantIfDelete0Error(0); redundantIfRemoveError(0); dangerousUsageStrtolError(0); - sprintfOverlappingDataError(0, "varname"); - udivError(0); udivWarning(0); unusedStructMemberError(0, "structname", "variable"); passedByValueError(0, "parametername"); @@ -162,8 +167,8 @@ public: variableScopeError(0, "varname"); conditionAlwaysTrueFalse(0, "true/false"); strPlusChar(0); - nullPointerError(0, "pointer"); - zerodivError(0); + + // optimisations postIncrementError(0, "varname", true); } @@ -175,19 +180,27 @@ public: std::string classInfo() const { return "Other checks\n" + + // error + " * [[OverlappingData|bad usage of the function 'sprintf' (overlapping data)]]\n" + " * division with zero\n" + " * null pointer dereferencing\n" + + // warning " * C-style pointer cast in cpp file\n" " * redundant if\n" " * bad usage of the function 'strtol'\n" - " * [[OverlappingData|bad usage of the function 'sprintf' (overlapping data)]]\n" - " * division with zero\n" " * [[CheckUnsignedDivision|unsigned division]]\n" " * unused struct member\n" " * passing parameter by value\n" + " * [[IncompleteStatement|Incomplete statement]]\n" " * [[charvar|check how signed char variables are used]]\n" + " * variable scope can be limited" " * condition that is always true/false\n" " * unusal pointer arithmetic. For example: \"abc\" + 'd'\n" - " * dereferencing a null pointer\n" - " * [[IncompleteStatement|Incomplete statement]]\n"; + + // optimisations + " * optimisation: detect post increment/decrement\n"; } }; /// @}