2024-04-15 22:41 ftp://ftp.de.debian.org/debian/pool/main/d/distorm3/distorm3_3.5.2b.orig.tar.gz cppcheck-options: --library=posix --library=gnu --library=bsd --library=python --inconclusive --enable=style,information --inline-suppr --template=daca2 --disable=missingInclude --suppress=unmatchedSuppression --check-library --debug-warnings --suppress=autoNoType --suppress=valueFlowBailout --suppress=bailoutUninitVar --suppress=symbolDatabaseWarning -D__GNUC__ --platform=unix64 -j4 platform: Linux-6.1.0-18-amd64-x86_64-with-glibc2.36 python: 3.11.2 client-version: 1.3.56 compiler: g++ (Debian 12.2.0-14) 12.2.0 cppcheck: head 2.13.0 head-info: 8cd680b (2024-04-15 22:43:04 +0200) count: 48 46 elapsed-time: 1.2 3.9 head-timing-info: old-timing-info: head results: distorm-3.5.2b/examples/ddk/main.c:36:19: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable Decode32Bits [valueFlowBailoutIncompleteVar] distorm-3.5.2b/examples/linux/main.c:85:50: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] distorm-3.5.2b/examples/tests/main.cpp:25:2: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] distorm-3.5.2b/examples/ddk/main.c:40:8: style: Variable 'errch' can be declared as pointer to const [constVariablePointer] distorm-3.5.2b/examples/tests/main.cpp:25:2: warning: %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] distorm-3.5.2b/examples/tests/main.cpp:25:2: warning: %d in format string (no. 3) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] distorm-3.5.2b/examples/tests/main.cpp:40:3: portability: %I64x in format string (no. 1) requires 'unsigned __int64' but the argument type is '_OffsetType {aka unsigned long}'. [invalidPrintfArgType_uint] distorm-3.5.2b/examples/tests/main.cpp:40:3: warning: %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] distorm-3.5.2b/examples/tests/main.cpp:40:65: style: C-style pointer casting [cstyleCast] distorm-3.5.2b/examples/ddk/main.c:40:8: style: Variable 'errch' is assigned a value that is never used. [unreadVariable] distorm-3.5.2b/examples/tests/main.cpp:38:11: style: Local variable 'i' shadows outer variable [shadowVariable] distorm-3.5.2b/examples/tests/main.cpp:22:45: note: Shadowed declaration distorm-3.5.2b/examples/tests/main.cpp:38:11: note: Shadow variable distorm-3.5.2b/examples/tests/main.cpp:22:47: style: Variable 'i' is assigned a value that is never used. [unreadVariable] distorm-3.5.2b/examples/tests/main.cpp:23:21: style: Variable 'offset' is assigned a value that is never used. [unreadVariable] distorm-3.5.2b/examples/tests/main.cpp:19:16: style: Unused variable: res [unusedVariable] distorm-3.5.2b/examples/java/jdistorm.c:334:38: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable JNI_VERSION_1_6 [valueFlowBailoutIncompleteVar] distorm-3.5.2b/examples/win32/main.cpp:89:14: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable INVALID_HANDLE_VALUE [valueFlowBailoutIncompleteVar] distorm-3.5.2b/examples/linux/main.c:140:26: portability: %llx in format string (no. 1) requires 'unsigned long long' but the argument type is '_OffsetType {aka unsigned long}'. [invalidPrintfArgType_uint] distorm-3.5.2b/examples/linux/main.c:141:7: portability: %llx in format string (no. 1) requires 'unsigned long long' but the argument type is '_OffsetType {aka unsigned long}'. [invalidPrintfArgType_uint] distorm-3.5.2b/examples/linux/main.c:160:4: warning: %d in format string (no. 3) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] distorm-3.5.2b/examples/win32/main.cpp:51:2: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned long'. [invalidPrintfArgType_sint] distorm-3.5.2b/examples/win32/main.cpp:51:2: warning: %d in format string (no. 2) requires 'int' but the argument type is 'unsigned long'. [invalidPrintfArgType_sint] distorm-3.5.2b/examples/win32/main.cpp:51:2: warning: %d in format string (no. 3) requires 'int' but the argument type is 'unsigned long'. [invalidPrintfArgType_sint] distorm-3.5.2b/examples/win32/main.cpp:121:26: portability: %I64x in format string (no. 1) requires 'unsigned __int64' but the argument type is '_OffsetType {aka unsigned long}'. [invalidPrintfArgType_uint] distorm-3.5.2b/examples/win32/main.cpp:122:7: portability: %I64x in format string (no. 1) requires 'unsigned __int64' but the argument type is '_OffsetType {aka unsigned long}'. [invalidPrintfArgType_uint] distorm-3.5.2b/examples/win32/main.cpp:141:4: warning: %d in format string (no. 3) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] distorm-3.5.2b/examples/win32/main.cpp:102:15: style: C-style pointer casting [cstyleCast] distorm-3.5.2b/examples/win32/main.cpp:131:33: style: C-style pointer casting [cstyleCast] distorm-3.5.2b/examples/win32/main.cpp:141:133: style: C-style pointer casting [cstyleCast] distorm-3.5.2b/examples/win32/main.cpp:25:16: style: The scope of the variable 'res' can be reduced. [variableScope] distorm-3.5.2b/examples/win32/main.cpp:30:48: style: The scope of the variable 'next' can be reduced. [variableScope] distorm-3.5.2b/examples/java/jdistorm.c:324:9: style: Condition 'ci!=NULL' is always true [knownConditionTrueFalse] distorm-3.5.2b/examples/java/jdistorm.c:137:2: warning: Unused variable value 'thiz' [constStatement] distorm-3.5.2b/examples/java/jdistorm.c:180:2: warning: Unused variable value 'thiz' [constStatement] distorm-3.5.2b/examples/java/jdistorm.c:277:2: warning: Unused variable value 'thiz' [constStatement] distorm-3.5.2b/examples/java/jdistorm.c:402:45: style: Parameter 'vm' can be declared as pointer to const [constParameterPointer] distorm-3.5.2b/examples/java/jdistorm.c:402:55: style: Parameter 'reserved' can be declared as pointer to const [constParameterPointer] distorm-3.5.2b/examples/java/jdistorm.c:178:6: style: Variable 'success' is assigned a value that is never used. [unreadVariable] distorm-3.5.2b/examples/java/jdistorm.c:274:44: style: Variable 'jOp' is assigned a value that is never used. [unreadVariable] distorm-3.5.2b/src/decoder.c:92:19: style: Variable 'isi' can be declared as pointer to const [constVariablePointer] distorm-3.5.2b/src/decoder.c:446:10: style: Variable 'maxResultAddr' can be declared as pointer to const [constVariablePointer] distorm-3.5.2b/src/decoder.c:205:29: error: Shifting signed 32-bit value by 31 bits is undefined behaviour [shiftTooManyBitsSigned] distorm-3.5.2b/src/wstring.h:28:24: error: Buffer is accessed out of bounds: (const int8_t*)reg->p [bufferAccessOutOfBounds] distorm-3.5.2b/src/prefix.c:355:52: style: Clarify calculation precedence for '&' and '?'. [clarifyCalculation] distorm-3.5.2b/src/operands.c:324:21: warning: Either the condition 'rm<4' is redundant or the array 'MODS[8]' is accessed at index 8, which is out of bounds. [arrayIndexOutOfBoundsCond] distorm-3.5.2b/src/operands.c:316:11: note: Assuming that condition 'rm<4' is not redundant distorm-3.5.2b/src/operands.c:324:21: note: Array index out of bounds distorm-3.5.2b/src/operands.c:314:19: style: Variable 'MODS' can be declared as const array [constVariable] distorm-3.5.2b/src/operands.c:315:19: style: Variable 'MODS2' can be declared as const array [constVariable] distorm-3.5.2b/src/operands.c:365:60: style: Parameter 'ii' can be declared as pointer to const [constParameterPointer] distorm-3.5.2b/src/operands.c:236:30: style: Variable 'base' is assigned a value that is never used. [unreadVariable] diff: head distorm-3.5.2b/examples/java/jdistorm.c:324:9: style: Condition 'ci!=NULL' is always true [knownConditionTrueFalse] 2.13.0 distorm-3.5.2b/examples/java/jdistorm.c:324:9: style: Condition 'ci!=NULL' is always true [knownConditionTrueFalse] distorm-3.5.2b/examples/java/jdistorm.c:280:9: note: Assuming condition 'ci==NULL' is false distorm-3.5.2b/examples/java/jdistorm.c:324:9: note: Condition 'ci!=NULL' is always true head distorm-3.5.2b/examples/java/jdistorm.c:402:45: style: Parameter 'vm' can be declared as pointer to const [constParameterPointer] head distorm-3.5.2b/examples/java/jdistorm.c:402:55: style: Parameter 'reserved' can be declared as pointer to const [constParameterPointer] head distorm-3.5.2b/examples/linux/main.c:140:26: portability: %llx in format string (no. 1) requires 'unsigned long long' but the argument type is '_OffsetType {aka unsigned long}'. [invalidPrintfArgType_uint] 2.13.0 distorm-3.5.2b/examples/linux/main.c:140:26: warning: %llx in format string (no. 1) requires 'unsigned long long' but the argument type is 'unsigned long'. [invalidPrintfArgType_uint] head distorm-3.5.2b/examples/linux/main.c:141:7: portability: %llx in format string (no. 1) requires 'unsigned long long' but the argument type is '_OffsetType {aka unsigned long}'. [invalidPrintfArgType_uint] 2.13.0 distorm-3.5.2b/examples/linux/main.c:141:7: warning: %llx in format string (no. 1) requires 'unsigned long long' but the argument type is 'unsigned long'. [invalidPrintfArgType_uint] head distorm-3.5.2b/examples/tests/main.cpp:40:3: portability: %I64x in format string (no. 1) requires 'unsigned __int64' but the argument type is '_OffsetType {aka unsigned long}'. [invalidPrintfArgType_uint] 2.13.0 distorm-3.5.2b/examples/tests/main.cpp:40:3: warning: %I64x in format string (no. 1) requires 'unsigned __int64' but the argument type is 'unsigned long'. [invalidPrintfArgType_uint] head distorm-3.5.2b/examples/win32/main.cpp:121:26: portability: %I64x in format string (no. 1) requires 'unsigned __int64' but the argument type is '_OffsetType {aka unsigned long}'. [invalidPrintfArgType_uint] 2.13.0 distorm-3.5.2b/examples/win32/main.cpp:121:26: warning: %I64x in format string (no. 1) requires 'unsigned __int64' but the argument type is 'unsigned long'. [invalidPrintfArgType_uint] head distorm-3.5.2b/examples/win32/main.cpp:122:7: portability: %I64x in format string (no. 1) requires 'unsigned __int64' but the argument type is '_OffsetType {aka unsigned long}'. [invalidPrintfArgType_uint] 2.13.0 distorm-3.5.2b/examples/win32/main.cpp:122:7: warning: %I64x in format string (no. 1) requires 'unsigned __int64' but the argument type is 'unsigned long'. [invalidPrintfArgType_uint] head distorm-3.5.2b/src/decoder.c:205:29: error: Shifting signed 32-bit value by 31 bits is undefined behaviour [shiftTooManyBitsSigned] 2.13.0 distorm-3.5.2b/src/decoder.c:205:29: portability: Shifting signed 32-bit value by 31 bits is implementation-defined behaviour [shiftTooManyBitsSigned] DONE