2025-05-05 17:59 ftp://ftp.de.debian.org/debian/pool/main/libf/libfile-rsyncp-perl/libfile-rsyncp-perl_0.74.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: fcc0493 (2025-05-05 13:08:11 +0200) count: 56 56 elapsed-time: 0.9 0.9 head-timing-info: old-timing-info: head results: File-RsyncP-0.74/Digest/rsync_lib.c:39:18: style: Variable 'buf' can be declared as pointer to const [constVariablePointer] File-RsyncP-0.74/FileList/exclude.c:322:14: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdin [valueFlowBailoutIncompleteVar] File-RsyncP-0.74/Digest/md4c.c:292:8: style: Parameter 'input' can be declared as pointer to const [constParameterPointer] File-RsyncP-0.74/Digest/md4c.c:311:16: style: Parameter 'input' can be declared as pointer to const [constParameterPointer] File-RsyncP-0.74/FileList/hlink.c:60:38: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable dev [valueFlowBailoutIncompleteVar] File-RsyncP-0.74/FileList/hlink.c:138:14: style: Variable 'flist->hlink_list' is assigned an expression that holds the same value. [redundantAssignment] File-RsyncP-0.74/FileList/hlink.c:112:16: note: hlink_list is assigned 'flist->hlink_list' here. File-RsyncP-0.74/FileList/hlink.c:138:14: note: Variable 'flist->hlink_list' is assigned an expression that holds the same value. File-RsyncP-0.74/FileList/flist.c:216:17: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] File-RsyncP-0.74/FileList/flist.c:448:17: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] File-RsyncP-0.74/FileList/flist.c:514:17: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable _S_IFCHR [valueFlowBailoutIncompleteVar] File-RsyncP-0.74/FileList/flist.c:1171:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] File-RsyncP-0.74/FileList/exclude.c:74:35: style: Obsolescent function 'index' called. It is recommended to use 'strchr' instead. [prohibitedindexCalled] File-RsyncP-0.74/FileList/exclude.c:119:18: style: Obsolescent function 'rindex' called. It is recommended to use 'strrchr' instead. [prohibitedrindexCalled] File-RsyncP-0.74/FileList/exclude.c:164:28: style: Obsolescent function 'index' called. It is recommended to use 'strchr' instead. [prohibitedindexCalled] File-RsyncP-0.74/FileList/exclude.c:195:17: style: Condition 'verbose>=2' is always false [knownConditionTrueFalse] File-RsyncP-0.74/FileList/exclude.c:290:25: style: Condition 'verbose>2' is always false [knownConditionTrueFalse] File-RsyncP-0.74/FileList/exclude.c:300:21: style: Condition 'verbose>2' is always false [knownConditionTrueFalse] File-RsyncP-0.74/FileList/exclude.c:406:13: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] File-RsyncP-0.74/FileList/exclude.c:43:12: warning: If memory allocation fails, then there is a possible null pointer dereference: ret [nullPointerOutOfMemory] File-RsyncP-0.74/FileList/exclude.c:39:11: note: Assuming allocation function fails File-RsyncP-0.74/FileList/exclude.c:39:11: note: Assignment 'ret=(struct exclude_struct*)malloc(sizeof(struct exclude_struct))', assigned value is 0 File-RsyncP-0.74/FileList/exclude.c:43:12: note: Null pointer dereference File-RsyncP-0.74/FileList/exclude.c:334:17: style: Local variable 'overflow' shadows outer function [shadowFunction] File-RsyncP-0.74/FileList/proto.h:233:6: note: Shadowed declaration File-RsyncP-0.74/FileList/exclude.c:334:17: note: Shadow variable File-RsyncP-0.74/FileList/exclude.c:218:56: style: Clarify calculation precedence for '&' and '?'. [clarifyCalculation] File-RsyncP-0.74/FileList/exclude.c:32:44: style: Parameter 'f' can be declared as pointer to const [constParameterPointer] File-RsyncP-0.74/FileList/exclude.c:105:48: style: Parameter 'f' can be declared as pointer to const [constParameterPointer] File-RsyncP-0.74/FileList/exclude.c:110:11: style: Variable 'pattern' can be declared as pointer to const [constVariablePointer] File-RsyncP-0.74/FileList/exclude.c:313:11: style: Variable 'eob' can be declared as pointer to const [constVariablePointer] File-RsyncP-0.74/FileList/exclude.c:427:11: style: Variable 'p' can be declared as pointer to const [constVariablePointer] File-RsyncP-0.74/FileList/pool_alloc.c:72:27: style:inconclusive: Function 'pool_destroy' argument 1 names different: declaration 'pool' definition 'p'. [funcArgNamesDifferent] File-RsyncP-0.74/FileList/pool_alloc.h:11:32: note: Function 'pool_destroy' argument 1 names different: declaration 'pool' definition 'p'. File-RsyncP-0.74/FileList/pool_alloc.c:72:27: note: Function 'pool_destroy' argument 1 names different: declaration 'pool' definition 'p'. File-RsyncP-0.74/FileList/pool_alloc.c:98:25: style:inconclusive: Function 'pool_alloc' argument 1 names different: declaration 'pool' definition 'p'. [funcArgNamesDifferent] File-RsyncP-0.74/FileList/pool_alloc.h:12:31: note: Function 'pool_alloc' argument 1 names different: declaration 'pool' definition 'p'. File-RsyncP-0.74/FileList/pool_alloc.c:98:25: note: Function 'pool_alloc' argument 1 names different: declaration 'pool' definition 'p'. File-RsyncP-0.74/FileList/pool_alloc.c:98:35: style:inconclusive: Function 'pool_alloc' argument 2 names different: declaration 'size' definition 'len'. [funcArgNamesDifferent] File-RsyncP-0.74/FileList/pool_alloc.h:12:44: note: Function 'pool_alloc' argument 2 names different: declaration 'size' definition 'len'. File-RsyncP-0.74/FileList/pool_alloc.c:98:35: note: Function 'pool_alloc' argument 2 names different: declaration 'size' definition 'len'. File-RsyncP-0.74/FileList/pool_alloc.c:175:24: style:inconclusive: Function 'pool_free' argument 1 names different: declaration 'pool' definition 'p'. [funcArgNamesDifferent] File-RsyncP-0.74/FileList/pool_alloc.h:13:29: note: Function 'pool_free' argument 1 names different: declaration 'pool' definition 'p'. File-RsyncP-0.74/FileList/pool_alloc.c:175:24: note: Function 'pool_free' argument 1 names different: declaration 'pool' definition 'p'. File-RsyncP-0.74/FileList/pool_alloc.c:175:34: style:inconclusive: Function 'pool_free' argument 2 names different: declaration 'size' definition 'len'. [funcArgNamesDifferent] File-RsyncP-0.74/FileList/pool_alloc.h:13:42: note: Function 'pool_free' argument 2 names different: declaration 'size' definition 'len'. File-RsyncP-0.74/FileList/pool_alloc.c:175:34: note: Function 'pool_free' argument 2 names different: declaration 'size' definition 'len'. File-RsyncP-0.74/FileList/pool_alloc.c:36:11: style: struct member 'align_test::foo' is never used. [unusedStructMember] File-RsyncP-0.74/FileList/snprintf.c:394:19: style: Condition 'maxlen>0' is always true [knownConditionTrueFalse] File-RsyncP-0.74/FileList/snprintf.c:391:13: note: Assuming that condition 'maxlen!=0' is not redundant File-RsyncP-0.74/FileList/snprintf.c:394:19: note: Condition 'maxlen>0' is always true File-RsyncP-0.74/FileList/snprintf.c:668:5: style: Condition 'caps' is always false [knownConditionTrueFalse] File-RsyncP-0.74/FileList/snprintf.c:603:13: note: Assignment 'caps=0', assigned value is 0 File-RsyncP-0.74/FileList/snprintf.c:668:5: note: Condition 'caps' is always false File-RsyncP-0.74/FileList/snprintf.c:381:10: style: Variable 'flags' is reassigned a value before the old one has been used. 'break;' missing? [redundantAssignInSwitch] File-RsyncP-0.74/FileList/snprintf.c:319:11: note: $symbol is assigned File-RsyncP-0.74/FileList/snprintf.c:381:10: note: $symbol is overwritten File-RsyncP-0.74/FileList/snprintf.c:381:10: style: Variable 'flags' is reassigned a value before the old one has been used. 'break;' missing? [redundantAssignInSwitch] File-RsyncP-0.74/FileList/snprintf.c:327:11: note: $symbol is assigned File-RsyncP-0.74/FileList/snprintf.c:381:10: note: $symbol is overwritten File-RsyncP-0.74/FileList/snprintf.c:379:7: style: Variable 'ch' is reassigned a value before the old one has been used. [redundantAssignment] File-RsyncP-0.74/FileList/snprintf.c:373:8: note: ch is assigned File-RsyncP-0.74/FileList/snprintf.c:379:7: note: ch is overwritten File-RsyncP-0.74/FileList/flist.c:234:21: style: Obsolescent function 'rindex' called. It is recommended to use 'strrchr' instead. [prohibitedrindexCalled] File-RsyncP-0.74/FileList/flist.c:216:9: warning: %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] File-RsyncP-0.74/FileList/flist.c:216:9: warning: %d in format string (no. 3) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] File-RsyncP-0.74/FileList/flist.c:1025:24: warning: Either the condition '!name' is redundant or there is overflow in pointer subtraction. [nullPointerArithmeticRedundantCheck] File-RsyncP-0.74/FileList/flist.c:1028:9: note: Assuming that condition '!name' is not redundant File-RsyncP-0.74/FileList/flist.c:1025:24: note: Null pointer subtraction File-RsyncP-0.74/FileList/flist.c:734:21: style: Checking if unsigned expression 'bufsize' is less than zero. [unsignedLessThanZero] File-RsyncP-0.74/FileList/flist.c:426:14: portability: Shifting a negative value is technically undefined behaviour [shiftNegativeLHS] File-RsyncP-0.74/FileList/flist.c:427:14: portability: Shifting a negative value is technically undefined behaviour [shiftNegativeLHS] File-RsyncP-0.74/FileList/flist.c:428:14: portability: Shifting a negative value is technically undefined behaviour [shiftNegativeLHS] File-RsyncP-0.74/FileList/flist.c:429:14: portability: Shifting a negative value is technically undefined behaviour [shiftNegativeLHS] File-RsyncP-0.74/FileList/flist.c:475:40: style:inconclusive: Function 'send_file_entry' argument 1 names different: declaration 'flist' definition 'f'. [funcArgNamesDifferent] File-RsyncP-0.74/FileList/proto.h:56:40: note: Function 'send_file_entry' argument 1 names different: declaration 'flist' definition 'f'. File-RsyncP-0.74/FileList/flist.c:475:40: note: Function 'send_file_entry' argument 1 names different: declaration 'flist' definition 'f'. File-RsyncP-0.74/FileList/flist.c:310:40: style: Clarify calculation precedence for '&' and '?'. [clarifyCalculation] File-RsyncP-0.74/FileList/flist.c:76:39: style: Parameter 'flist' can be declared as pointer to const [constParameterPointer] File-RsyncP-0.74/FileList/flist.c:410:48: style: Parameter 'buf' can be declared as pointer to const [constParameterPointer] File-RsyncP-0.74/FileList/flist.c:991:37: style: Parameter 'f' can be declared as pointer to const [constParameterPointer] File-RsyncP-0.74/FileList/flist.c:1025:11: style: Variable 'limit' can be declared as pointer to const [constVariablePointer] File-RsyncP-0.74/FileList/flist.c:1098:11: style: Variable 'start' can be declared as pointer to const [constVariablePointer] File-RsyncP-0.74/FileList/flist.c:1169:26: style: Parameter 'str' can be declared as pointer to const. However it seems that 'out_of_memory' is a callback function, if 'str' is declared with const you might also need to cast function pointer(s). [constParameterCallback] File-RsyncP-0.74/FileList/flist.c:829:35: note: You might need to cast the function pointer here File-RsyncP-0.74/FileList/flist.c:1169:26: note: Parameter 'str' can be declared as pointer to const File-RsyncP-0.74/FileList/flist.c:419:36: warning: Uninitialized variable: buf [uninitvar] File-RsyncP-0.74/FileList/flist.c:456:15: note: Calling function 'writefd', 2nd argument 'b' value is File-RsyncP-0.74/FileList/flist.c:419:36: note: Uninitialized variable: buf File-RsyncP-0.74/FileList/wildmatch.c:97:26: style: Obsolescent function 'index' called. It is recommended to use 'strchr' instead. [prohibitedindexCalled] File-RsyncP-0.74/FileList/wildmatch.c:223:42: style:inconclusive: Function 'wildmatch' argument 2 names different: declaration 'text' definition 't'. [funcArgNamesDifferent] File-RsyncP-0.74/FileList/wildmatch.h:3:42: note: Function 'wildmatch' argument 2 names different: declaration 'text' definition 't'. File-RsyncP-0.74/FileList/wildmatch.c:223:42: note: Function 'wildmatch' argument 2 names different: declaration 'text' definition 't'. diff: DONE