cppcheck warnings for Arx in branch 1.1-branch
(error) Array accessed at index -1, which is out of bounds.
(0 |
-3
)
(error) Common realloc mistake: nulled but not freed upon failure
(0 |
-7
)
(error) Deallocation of an global variable results in undefined behaviour.
(0 |
-1
)
(error) Memory leak
(0 |
-3
)
(error) Memory pointed to by is freed twice.
(0 |
-3
)
(error) Overflow in pointer arithmetic, NULL pointer is subtracted.
(0 |
-1
)
(error) Resource leak: f
(0 |
-1
)
(error) Returning pointer to local variable that will be invalid when returning.
(0 |
-1
)
(error) Shifting signed 32-bit value by 31 bits is undefined behaviour
(0 |
-1
)
(error) Uninitialized class member: acs.endpos
(0 |
-1
)
(error) Uninitialized class member: acs.f0
(0 |
-1
)
(error) Uninitialized class member: acs.f1
(0 |
-1
)
(error) Uninitialized class member: acs.f2
(0 |
-1
)
(error) Uninitialized class member: acs.ionum
(0 |
-1
)
(error) Uninitialized class member: acs.startpos
(0 |
-1
)
(error) Uninitialized variable: intVal
(0 |
-1
)
(error) Uninitialized variable: val
(0 |
-2
)
(performance) Function parameter should be passed by const reference.
(0 |
-2
)
(performance) Prefer prefix ++/-- operators for non-primitive types.
(0 |
-11
)
(performance) Searching before insertion is not necessary.
(0 |
-1
)
(performance) Variable is assigned in constructor body. Consider performing initialization in initialization list.
(0 |
-41
)
(portability) Using memset() on class which contains a floating point number.
(0 |
-70
)
(style) Boolean result is used in bitwise operation. Clarify expression with parentheses.
(0 |
-7
)
(style) Boolean value assigned to floating point variable.
(0 |
-6
)
(style) Checking if unsigned expression is less than zero.
(0 |
-12
)
(style) Clarify calculation precedence for and.
(0 |
-2
)
(style) Class does not have a constructor although it has private member variables.
(0 |
-8
)
(style) class member is never used.
(0 |
-4
)
(style) Condition is always false
(0 |
-19
)
(style) Condition is always true
(0 |
-27
)
(style) Consecutive return, break, continue, goto or throw statements are unnecessary.
(0 |
-1
)
(style) C-style pointer casting
(0 |
-305
)
(style) Local variable shadows outer argument
(0 |
-21
)
(style) Local variable shadows outer function
(0 |
-31
)
(style) Local variable shadows outer variable
(0 |
-103
)
(style) Redundant condition: ause1->cur_anim. is equivalent to
(0 |
-1
)
(style) Redundant condition: CURRENT_TORCH. is equivalent to
(0 |
-1
)
(style) Redundant condition: found!=NULL. is equivalent to
(0 |
-4
)
(style) Redundant condition: io==entities.player(). is equivalent to
(0 |
-1
)
(style) Redundant condition: pMenu. is equivalent to
(0 |
-1
)
(style) Redundant condition: pWindowMenu. is equivalent to
(0 |
-1
)
(style) Redundant condition: source==0. is equivalent to
(0 |
-2
)
(style) Same expression on both sides of.
(0 |
-2
)
(style) Same expression used in consecutive assignments of and.
(0 |
-2
)
(style) should return.
(0 |
-1
)
(style) should return reference to instance.
(0 |
-4
)
(style) The expression is always true.
(0 |
-1
)
(style) The expression is always true because and represent the same value.
(0 |
-4
)
(style) The function overrides a function in a base class but is not marked with a specifier.
(0 |
-404
)
(style) The if condition is the same as the previous if condition
(0 |
-8
)
(style) The scope of the variable can be reduced.
(0 |
-73
)
(style) The statement is logically equivalent to.
(0 |
-10
)
(style) Unused variable: tex
(0 |
-1
)
(style) Variable is assigned a value that is never used.
(0 |
-47
)
(style) Variable is not assigned a value.
(0 |
-1
)
(style) Variable is reassigned a value before the old one has been used.
(0 |
-22
)
(warning) Class does not have a copy constructor which is recommended since it has dynamic memory/resource allocation(s).
(0 |
-9
)
(warning) Class does not have a operator= which is recommended since it has dynamic memory/resource allocation(s).
(0 |
-9
)
(warning) Either the condition is redundant or there is overflow in pointer subtraction.
(0 |
-7
)
(warning) Either the condition is redundant or there is possible null pointer dereference: dat.
(0 |
-1
)
(warning) Either the condition is redundant or there is possible null pointer dereference: ep.
(0 |
-9
)
(warning) Either the condition is redundant or there is possible null pointer dereference: _io.
(0 |
-1
)
(warning) Either the condition is redundant or there is possible null pointer dereference: io.
(0 |
-10
)
(warning) Either the condition is redundant or there is possible null pointer dereference: out.
(0 |
-4
)
(warning) Either the condition is redundant or there is possible null pointer dereference: p.
(0 |
-7
)
(warning) Found calculation inside sizeof().
(0 |
-1
)
(warning) Function argument order different: declaration definition
(0 |
-1
)
(warning) Identical inner condition is always true.
(0 |
-1
)
(warning) Member variable is not initialized in the constructor.
(0 |
-273
)
(warning) Null pointer dereference: ep
(0 |
-2
)
(warning) Possible null pointer dereference: out
(0 |
-1
)
(warning) Redundant assignment of to itself.
(0 |
-1
)
(warning) Redundant code: Found a statement that begins with string constant.
(0 |
-1
)
(warning) sscanf() without field width limits can crash with huge input data.
(0 |
-1
)
(warning) Virtual function is called from constructor. Dynamic binding is not used.
(0 |
-5
)
(warning) Virtual function is called from destructor. Dynamic binding is not used.
(0 |
-3
)
arrayIndexOutOfBoundsCond
(1 |
+1
)
autovarInvalidDeallocation
(1 |
+1
)
clarifyCalculation
(1 |
+1
)
ctunullpointer
(1 |
+1
)
duplicateBreak
(1 |
+1
)
duplicateCondition
(1 |
+1
)
funcArgOrderDifferent
(1 |
+1
)
identicalInnerCondition
(1 |
+1
)
invalidscanf
(1 |
+1
)
memsetClass
(1 |
+1
)
mismatchingContainers
(1 |
+1
)
resourceLeak
(1 |
+1
)
returnNonBoolInBooleanFunction
(1 |
+1
)
shiftTooManyBitsSigned
(1 |
+1
)
sizeofCalculation
(1 |
+1
)
stlFindInsert
(1 |
+1
)
truncLongCastAssignment
(1 |
+1
)
uninitvar
(1 |
+1
)
unusedVariable
(1 |
+1
)
uselessOverride
(1 |
+1
)
badBitmaskCheck
(2 |
+2
)
constParameterCallback
(2 |
+2
)
ctuOneDefinitionRuleViolation
(2 |
+2
)
duplicateAssignExpression
(2 |
+2
)
duplicateExpression
(2 |
+2
)
memleak
(2 |
+2
)
(ungrouped warnings)
(2 |
+2
)
virtualCallInConstructor
(2 |
+2
)
constStatement
(3 |
+3
)
selfAssignment
(3 |
+3
)
uselessCallsSubstr
(3 |
+3
)
operatorEqRetRefThis
(4 |
+4
)
redundantInitialization
(4 |
+4
)
unknownMacro
(4 |
+4
)
nullPointerArithmeticRedundantCheck
(5 |
+5
)
assignBoolToFloat
(6 |
+6
)
constVariableReference
(6 |
+6
)
uninitStructMember
(6 |
+6
)
useStlAlgorithm
(6 |
+6
)
clarifyCondition
(7 |
+7
)
constVariable
(7 |
+7
)
memleakOnRealloc
(7 |
+7
)
moduloofone
(7 |
+7
)
noConstructor
(7 |
+7
)
uninitDerivedMemberVar
(8 |
+8
)
noCopyConstructor
(9 |
+9
)
noOperatorEq
(9 |
+9
)
unusedStructMember
(9 |
+9
)
postfixOperator
(11 |
+11
)
redundantCondition
(11 |
+11
)
unsignedLessThanZero
(11 |
+11
)
duplicateConditionalAssign
(12 |
+12
)
constParameterReference
(13 |
+13
)
redundantAssignment
(15 |
+15
)
duplInheritedMember
(21 |
+21
)
shadowArgument
(22 |
+22
)
nullPointerRedundantCheck
(31 |
+31
)
shadowFunction
(34 |
+34
)
passedByValue
(41 |
+41
)
useInitializationList
(41 |
+41
)
unreadVariable
(67 |
+67
)
variableScope
(70 |
+70
)
knownConditionTrueFalse
(80 |
+80
)
shadowVariable
(106 |
+106
)
memsetClassFloat
(119 |
+119
)
constVariablePointer
(148 |
+148
)
constParameterPointer
(184 |
+184
)
uninitMemberVar
(269 |
+269
)
cstyleCast
(458 |
+458
)
missingOverride
(574 |
+574
)