2025-05-07 21:58 ftp://ftp.de.debian.org/debian/pool/main/s/scanmem/scanmem_0.17.orig.tar.gz cppcheck-options: --library=posix --library=gnu --library=bsd --inconclusive --enable=style,information --inline-suppr --template=daca2 --disable=missingInclude --suppress=unmatchedSuppression --check-library --debug-warnings --suppress=autoNoType --suppress=valueFlowBailout --suppress=bailoutUninitVar --suppress=symbolDatabaseWarning --suppress=normalCheckLevelConditionExpressions -D__GNUC__ --platform=unix64 -j3 platform: Linux-6.8.0-1022-oracle-aarch64-with-glibc2.39 python: 3.12.3 client-version: 1.3.67 compiler: g++ (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 cppcheck: head 2.17.0 head-info: ebc80c0 (2025-05-07 18:59:31 +0200) count: 111 111 elapsed-time: 1.3 1.4 head-timing-info: old-timing-info: head results: scanmem-0.17/list.c:87:16: style: Variable 'n' can be declared as pointer to const [constVariablePointer] scanmem-0.17/main.c:80:20: error: There is an unknown macro here somewhere. Configuration is required. If PACKAGE_BUGREPORT is a macro then please configure it. [unknownMacro] scanmem-0.17/commands.c:104:17: warning: Obsolete function 'alloca' called. In C99 and later it is recommended to use a variable length array instead. [allocaCalled] scanmem-0.17/commands.c:116:28: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] scanmem-0.17/commands.c:110:14: error: Common realloc mistake: 'argv' nulled but not freed upon failure [memleakOnRealloc] scanmem-0.17/targetmem.h:101:54: style: Parameter 'swath' can be declared as pointer to const [constParameterPointer] scanmem-0.17/targetmem.h:107:62: style: Parameter 'swath' can be declared as pointer to const [constParameterPointer] scanmem-0.17/targetmem.h:132:33: style: Parameter 'last_byte_to_reach_plus_one' can be declared as pointer to const [constParameterPointer] scanmem-0.17/targetmem.h:109:39: portability: 'swath->first_byte_in_child' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/targetmem.h:168:56: portability: '(void*)(*swath_pointer_to_correct)' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/targetmem.h:189:65: portability: '(void*)swath' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/targetmem.h:190:50: portability: '(void*)swath+sizeof(struct matches_and_old_values_swath)' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/targetmem.h:212:58: portability: 'local_address_beyond_last_element(swath)' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/targetmem.h:223:58: portability: 'local_address_beyond_last_element(swath)' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/handlers.c:109:23: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable O_NONBLOCK [valueFlowBailoutIncompleteVar] scanmem-0.17/handlers.c:326:54: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable PRIx64 [valueFlowBailoutIncompleteVar] scanmem-0.17/handlers.c:677:71: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable id [valueFlowBailoutIncompleteVar] scanmem-0.17/handlers.c:750:17: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] scanmem-0.17/handlers.c:866:24: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] scanmem-0.17/handlers.c:1159:18: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] scanmem-0.17/handlers.c:1315:28: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] scanmem-0.17/handlers.c:1340:5: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable errno [valueFlowBailoutIncompleteVar] scanmem-0.17/handlers.c:1522:18: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable PRId8 [valueFlowBailoutIncompleteVar] scanmem-0.17/menu.c:119:9: warning: %ld in format string (no. 1) requires 'long' but the argument type is 'unsigned long'. [invalidPrintfArgType_sint] scanmem-0.17/menu.c:71:20: style: Variable 'command' can be declared as pointer to const [constVariablePointer] scanmem-0.17/menu.c:111:28: style: Parameter 'vars' can be declared as pointer to const [constParameterPointer] scanmem-0.17/menu.c:114:18: style: Variable 'success' is assigned a value that is never used. [unreadVariable] scanmem-0.17/ptrace.c:97:16: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable PTRACE_ATTACH [valueFlowBailoutIncompleteVar] scanmem-0.17/ptrace.c:120:19: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable PTRACE_DETACH [valueFlowBailoutIncompleteVar] scanmem-0.17/ptrace.c:182:5: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable errno [valueFlowBailoutIncompleteVar] scanmem-0.17/ptrace.c:242:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] scanmem-0.17/ptrace.c:420:25: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable O_RDONLY [valueFlowBailoutIncompleteVar] scanmem-0.17/ptrace.c:470:48: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable size [valueFlowBailoutIncompleteVar] scanmem-0.17/ptrace.c:656:20: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable PTRACE_POKEDATA [valueFlowBailoutIncompleteVar] scanmem-0.17/ptrace.c:696:9: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable errno [valueFlowBailoutIncompleteVar] scanmem-0.17/ptrace.c:719:20: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable PTRACE_POKEDATA [valueFlowBailoutIncompleteVar] scanmem-0.17/ptrace.c:321:59: portability: 'reading_swath.first_byte_in_child' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/ptrace.c:540:51: portability: 'r->start' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/ptrace.c:572:98: portability: 'r->start' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/ptrace.c:581:98: portability: 'r->start' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/ptrace.c:656:50: portability: 'addr' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/ptrace.c:697:66: portability: 'addr' is of type 'const void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/ptrace.c:719:50: portability: 'addr' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/ptrace.c:719:70: portability: 'data' is of type 'const void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/ptrace.c:728:54: portability: 'addr' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/ptrace.c:728:60: portability: 'addr+len' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/ptrace.c:728:91: portability: 'data' is of type 'const void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/ptrace.c:728:97: portability: 'data+len' is of type 'const void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/ptrace.c:738:72: portability: 'addr' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/ptrace.c:751:58: portability: 'data' is of type 'const void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/ptrace.c:753:62: portability: 'addr' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/maps.c:96:29: warning: Obsolete function 'alloca' called. In C99 and later it is recommended to use a variable length array instead. [allocaCalled] scanmem-0.17/maps.c:105:17: warning: %x in format string (no. 7) requires 'unsigned int *' but the argument type is 'signed int *'. [invalidScanfArgType_int] scanmem-0.17/maps.c:105:17: warning: %x in format string (no. 8) requires 'unsigned int *' but the argument type is 'signed int *'. [invalidScanfArgType_int] scanmem-0.17/maps.c:105:17: warning: %x in format string (no. 9) requires 'unsigned int *' but the argument type is 'signed int *'. [invalidScanfArgType_int] scanmem-0.17/maps.c:105:17: warning: %u in format string (no. 10) requires 'unsigned int *' but the argument type is 'signed int *'. [invalidScanfArgType_int] scanmem-0.17/maps.c:105:17: warning: sscanf() without field width limits can crash with huge input data. [invalidscanf] scanmem-0.17/readline.c:47:12: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdout [valueFlowBailoutIncompleteVar] scanmem-0.17/scanmem.c:46:47: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable PACKAGE_VERSION [valueFlowBailoutIncompleteVar] scanmem-0.17/scanmem.c:214:12: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdout [valueFlowBailoutIncompleteVar] scanmem-0.17/scanmem.c:225:12: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable PACKAGE_VERSION [valueFlowBailoutIncompleteVar] scanmem-0.17/handlers.c:212:16: warning: Obsolete function 'alloca' called. In C99 and later it is recommended to use a variable length array instead. [allocaCalled] scanmem-0.17/handlers.c:227:17: warning: Obsolete function 'alloca' called. In C99 and later it is recommended to use a variable length array instead. [allocaCalled] scanmem-0.17/handlers.c:263:17: warning: Obsolete function 'alloca' called. In C99 and later it is recommended to use a variable length array instead. [allocaCalled] scanmem-0.17/handlers.c:1190:15: warning: Obsolete function 'alloca' called. In C99 and later it is recommended to use a variable length array instead. [allocaCalled] scanmem-0.17/handlers.c:1262:52: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] scanmem-0.17/handlers.c:1287:60: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] scanmem-0.17/sets.c:113:51: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] scanmem-0.17/handlers.c:452:17: error: Common realloc mistake: 'v' nulled but not freed upon failure [memleakOnRealloc] scanmem-0.17/handlers.c:465:17: error: Common realloc mistake: 'v' nulled but not freed upon failure [memleakOnRealloc] scanmem-0.17/handlers.c:1156:9: style: Variable 'ret' is reassigned a value before the old one has been used. [redundantAssignment] scanmem-0.17/handlers.c:1150:13: note: ret is assigned scanmem-0.17/handlers.c:1156:9: note: ret is overwritten scanmem-0.17/handlers.c:1156:9: style: Variable 'ret' is reassigned a value before the old one has been used. [redundantAssignment] scanmem-0.17/handlers.c:1153:13: note: ret is assigned scanmem-0.17/handlers.c:1156:9: note: ret is overwritten scanmem-0.17/handlers.c:492:27: style: Variable 'region' can be declared as pointer to const [constVariablePointer] scanmem-0.17/handlers.c:694:23: style: Variable 'r' can be declared as pointer to const [constVariablePointer] scanmem-0.17/handlers.c:748:19: style: Variable 'region' can be declared as pointer to const [constVariablePointer] scanmem-0.17/handlers.c:1324:32: style: Parameter 'vars' can be declared as pointer to const [constParameterPointer] scanmem-0.17/handlers.c:1326:11: style: Variable 'addr' can be declared as pointer to const [constVariablePointer] scanmem-0.17/handlers.c:1497:33: style: Parameter 'vars' can be declared as pointer to const [constParameterPointer] scanmem-0.17/handlers.c:716:54: portability: 'reg_to_delete->start' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/handlers.c:1411:36: portability: 'addr' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/handlers.c:1428:36: portability: 'addr' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/sets.c:184:17: style: The statement 'if (is_hex) is_hex=false' is logically equivalent to 'is_hex=false'. [duplicateConditionalAssign] scanmem-0.17/sets.c:185:24: note: Assignment 'is_hex=false' scanmem-0.17/sets.c:184:17: note: Condition 'is_hex' is redundant scanmem-0.17/sets.c:247:17: style: The statement 'if (!got_num) got_num=true' is logically equivalent to 'got_num=true'. [duplicateConditionalAssign] scanmem-0.17/sets.c:248:25: note: Assignment 'got_num=true' scanmem-0.17/sets.c:247:17: note: Condition '!got_num' is redundant scanmem-0.17/show_message.c:32:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] scanmem-0.17/show_message.c:41:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] scanmem-0.17/show_message.c:50:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] scanmem-0.17/show_message.c:61:18: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] scanmem-0.17/show_message.c:72:17: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] scanmem-0.17/sets.c:183:31: warning: If memory allocation fails, then there is a possible null pointer dereference: tmpnum [nullPointerOutOfMemory] scanmem-0.17/sets.c:180:29: note: Assuming allocation function fails scanmem-0.17/sets.c:180:29: note: Assignment 'tmpnum=strndup(tok,tmpnum_end-tok)', assigned value is 0 scanmem-0.17/sets.c:183:31: note: Null pointer dereference scanmem-0.17/scanroutines.c:268:1: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable int8_value [valueFlowBailoutIncompleteVar] scanmem-0.17/scanroutines.c:269:1: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable int16_value [valueFlowBailoutIncompleteVar] scanmem-0.17/scanroutines.c:270:1: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable int16_value [valueFlowBailoutIncompleteVar] scanmem-0.17/scanroutines.c:271:1: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable int32_value [valueFlowBailoutIncompleteVar] scanmem-0.17/scanroutines.c:272:1: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable int32_value [valueFlowBailoutIncompleteVar] scanmem-0.17/scanroutines.c:273:1: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable int64_value [valueFlowBailoutIncompleteVar] scanmem-0.17/scanroutines.c:274:1: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable int64_value [valueFlowBailoutIncompleteVar] scanmem-0.17/scanroutines.c:293:1: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable float32_value [valueFlowBailoutIncompleteVar] scanmem-0.17/scanroutines.c:294:1: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable float32_value [valueFlowBailoutIncompleteVar] scanmem-0.17/scanroutines.c:295:1: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable float64_value [valueFlowBailoutIncompleteVar] scanmem-0.17/scanroutines.c:296:1: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable float64_value [valueFlowBailoutIncompleteVar] scanmem-0.17/scanroutines.c:383:82: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable uint64_value [valueFlowBailoutIncompleteVar] scanmem-0.17/scanroutines.c:484:47: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable int64_value [valueFlowBailoutIncompleteVar] scanmem-0.17/value.c:63:64: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable PRIu64 [valueFlowBailoutIncompleteVar] scanmem-0.17/value.c:220:5: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable errno [valueFlowBailoutIncompleteVar] scanmem-0.17/value.c:256:5: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable errno [valueFlowBailoutIncompleteVar] scanmem-0.17/targetmem.c:127:57: warning: Either the condition '!matches' is redundant or there is possible null pointer dereference: matches. [nullPointerRedundantCheck] scanmem-0.17/targetmem.c:131:9: note: Assuming that condition '!matches' is not redundant scanmem-0.17/targetmem.c:127:57: note: Null pointer dereference scanmem-0.17/targetmem.c:162:32: style: Parameter 'start_address' can be declared as pointer to const [constParameterPointer] scanmem-0.17/targetmem.c:162:53: style: Parameter 'end_address' can be declared as pointer to const [constParameterPointer] scanmem-0.17/targetmem.c:63:65: portability: '(void*)swath' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/targetmem.c:70:35: portability: '(void*)swath' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/targetmem.c:179:59: portability: 'reading_swath.first_byte_in_child' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] diff: DONE