2024-04-22 22:39 ftp://ftp.de.debian.org/debian/pool/main/t/tree/tree_2.1.1.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 -D__GNUC__ --platform=unix64 -j1 platform: Linux-5.15.0-105-generic-x86_64-with-glibc2.35 python: 3.10.12 client-version: 1.3.56 compiler: g++ (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0 cppcheck: head 2.14.0 head-info: bd7136d (2024-04-22 21:34:48 +0200) count: 81 81 elapsed-time: 8.8 9.4 head-timing-info: old-timing-info: head results: tree-2.1.1/color.c:237:18: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable S_ISVTX [valueFlowBailoutIncompleteVar] tree-2.1.1/color.c:456:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] tree-2.1.1/color.c:165:19: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] tree-2.1.1/color.c:169:21: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] tree-2.1.1/color.c:78:41: style: Variable 's' can be declared as pointer to const [constVariablePointer] tree-2.1.1/color.c:160:31: style: Parameter 'delim' can be declared as pointer to const [constParameterPointer] tree-2.1.1/color.c:176:15: style: Parameter 's' can be declared as pointer to const [constParameterPointer] tree-2.1.1/color.c:217:31: style: Parameter 'name' can be declared as pointer to const [constParameterPointer] tree-2.1.1/color.c:288:9: style: Variable 'cs' can be declared as pointer to const [constVariablePointer] tree-2.1.1/file.c:185:45: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdin [valueFlowBailoutIncompleteVar] tree-2.1.1/file.c:250:45: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdin [valueFlowBailoutIncompleteVar] tree-2.1.1/file.c:67:28: style: Parameter 'name' can be declared as pointer to const [constParameterPointer] tree-2.1.1/file.c:116:19: style: Variable 'com' can be declared as pointer to const [constVariablePointer] tree-2.1.1/file.c:183:39: style: Parameter 'd' can be declared as pointer to const [constParameterPointer] tree-2.1.1/filter.c:42:35: style: Parameter 'pattern' can be declared as pointer to const [constParameterPointer] tree-2.1.1/hash.c:41:14: portability: Non reentrant function 'getpwuid' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwuid_r'. [prohibitedgetpwuidCalled] tree-2.1.1/hash.c:68:14: portability: Non reentrant function 'getgrgid' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getgrgid_r'. [prohibitedgetgrgidCalled] tree-2.1.1/hash.c:30:18: style: Variable 'ent' can be declared as pointer to const [constVariablePointer] tree-2.1.1/hash.c:57:17: style: Variable 'ent' can be declared as pointer to const [constVariablePointer] tree-2.1.1/html.c:258:5: warning: %ld in format string (no. 1) requires 'long' but the argument type is 'unsigned long'. [invalidPrintfArgType_sint] tree-2.1.1/html.c:260:5: warning: %ld in format string (no. 1) requires 'long' but the argument type is 'unsigned long'. [invalidPrintfArgType_sint] tree-2.1.1/html.c:260:5: warning: %ld in format string (no. 3) requires 'long' but the argument type is 'unsigned long'. [invalidPrintfArgType_sint] tree-2.1.1/html.c:96:17: style: Parameter 'filename' can be declared as pointer to const [constParameterPointer] tree-2.1.1/html.c:231:22: style: Parameter 'error' can be declared as pointer to const [constParameterPointer] tree-2.1.1/html.c:242:31: style: Parameter 'file' can be declared as pointer to const [constParameterPointer] tree-2.1.1/info.c:48:37: style: Parameter 'path' can be declared as pointer to const [constParameterPointer] tree-2.1.1/info.c:184:46: style: Parameter 's' can be declared as pointer to const [constParameterPointer] tree-2.1.1/info.c:105:30: style: Variable 'cend' is assigned a value that is never used. [unreadVariable] tree-2.1.1/info.c:106:15: style: Variable 'cend' is assigned a value that is never used. [unreadVariable] tree-2.1.1/json.c:86:82: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable S_IRWXU [valueFlowBailoutIncompleteVar] tree-2.1.1/json.c:189:3: warning: %ld in format string (no. 1) requires 'long' but the argument type is 'unsigned long'. [invalidPrintfArgType_sint] tree-2.1.1/json.c:190:15: warning: %ld in format string (no. 1) requires 'long' but the argument type is 'unsigned long'. [invalidPrintfArgType_sint] tree-2.1.1/json.c:55:9: style: Variable 'ctrl' can be declared as pointer to const [constVariablePointer] tree-2.1.1/json.c:75:34: style: Parameter 'ent' can be declared as pointer to const [constParameterPointer] tree-2.1.1/json.c:116:49: style: Parameter 'file' can be declared as pointer to const [constParameterPointer] tree-2.1.1/json.c:166:22: style: Parameter 'error' can be declared as pointer to const [constParameterPointer] tree-2.1.1/list.c:184:58: style: Redundant condition: (*dir)->lnk. '!(*dir)->lnk || ((*dir)->lnk && lflag)' is equivalent to '!(*dir)->lnk || lflag' [redundantCondition] tree-2.1.1/list.c:54:31: style: Parameter 'file' can be declared as pointer to const [constParameterPointer] tree-2.1.1/tree.c:109:10: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] tree-2.1.1/tree.c:146:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable LC_CTYPE [valueFlowBailoutIncompleteVar] tree-2.1.1/tree.c:592:36: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdout [valueFlowBailoutIncompleteVar] tree-2.1.1/tree.c:611:26: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdout [valueFlowBailoutIncompleteVar] tree-2.1.1/tree.c:793:32: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable S_IXUSR [valueFlowBailoutIncompleteVar] tree-2.1.1/tree.c:1076:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] tree-2.1.1/tree.c:1086:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] tree-2.1.1/tree.c:1286:9: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable S_IRUSR [valueFlowBailoutIncompleteVar] tree-2.1.1/tree.c:1398:39: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable S_IXUSR [valueFlowBailoutIncompleteVar] tree-2.1.1/tree.c:1422:33: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable S_IXUSR [valueFlowBailoutIncompleteVar] tree-2.1.1/tree.c:835:33: portability: Non reentrant function 'readdir' called. For threadsafe applications it is recommended to use the reentrant replacement function 'readdir_r'. [prohibitedreaddirCalled] tree-2.1.1/tree.c:1304:8: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] tree-2.1.1/tree.c:1172:20: style: Redundant condition: The condition '*pat' is redundant since '*pat == '\\'' is sufficient. [redundantCondition] tree-2.1.1/tree.c:1044:20: style: Condition '(*a)->mtime==(*b)->mtime' is always false [knownConditionTrueFalse] tree-2.1.1/tree.c:1056:19: style: Condition '(*a)->ctime==(*b)->ctime' is always false [knownConditionTrueFalse] tree-2.1.1/tree.c:906:25: style: Variable 'start_rel_path' is reassigned a value before the old one has been used. [redundantAssignment] tree-2.1.1/tree.c:905:20: note: start_rel_path is assigned tree-2.1.1/tree.c:906:25: note: start_rel_path is overwritten tree-2.1.1/tree.c:909:19: style: Checking if unsigned expression 'lev_tmp' is less than zero. [unsignedLessThanZero] tree-2.1.1/tree.c:889:36: style: Local variable 'sp' shadows outer variable [shadowVariable] tree-2.1.1/tree.c:41:48: note: Shadowed declaration tree-2.1.1/tree.c:889:36: note: Shadow variable tree-2.1.1/tree.c:141:30: style: Argument 'sizeof(int)*(maxdirs=4096)' to function xmalloc is always 16384. It does not matter what value 'maxdirs' has. [knownArgument] tree-2.1.1/tree.c:530:63: style: Argument 'sizeof(char*)*(q=30)' to function xmalloc is always 240. It does not matter what value 'q' has. [knownArgument] tree-2.1.1/tree.c:833:56: style: Argument 'sizeof(struct _info*)*(ne=30)' to function xmalloc is always 240. It does not matter what value 'ne' has. [knownArgument] tree-2.1.1/tree.c:98:59: style: Parameter 'prefix' can be declared as pointer to const [constParameterPointer] tree-2.1.1/tree.c:130:9: style: Variable 'stmp' can be declared as pointer to const [constVariablePointer] tree-2.1.1/tree.c:580:24: style: Variable 'v' can be declared as pointer to const [constVariablePointer] tree-2.1.1/tree.c:586:22: style: Parameter 'filename' can be declared as pointer to const [constParameterPointer] tree-2.1.1/tree.c:817:19: style: Variable 'com' can be declared as pointer to const [constVariablePointer] tree-2.1.1/tree.c:1110:11: style: Variable 'value' can be declared as pointer to const [constVariablePointer] tree-2.1.1/tree.c:1302:14: style: Variable 'tm' can be declared as pointer to const [constVariablePointer] tree-2.1.1/tree.c:1378:9: style: Variable 'unit' can be declared as pointer to const [constVariablePointer] tree-2.1.1/tree.c:1402:38: style: Parameter 'st' can be declared as pointer to const [constParameterPointer] tree-2.1.1/tree.c:1427:41: style: Parameter 'ent' can be declared as pointer to const [constParameterPointer] tree-2.1.1/tree.c:129:11: style: Variable 'j' is assigned a value that is never used. [unreadVariable] tree-2.1.1/tree.c:131:9: style: Unused variable: stddata_fd [unusedVariable] tree-2.1.1/unix.c:108:5: warning: %ld in format string (no. 1) requires 'long' but the argument type is 'unsigned long'. [invalidPrintfArgType_sint] tree-2.1.1/unix.c:110:5: warning: %ld in format string (no. 1) requires 'long' but the argument type is 'unsigned long'. [invalidPrintfArgType_sint] tree-2.1.1/unix.c:110:5: warning: %ld in format string (no. 3) requires 'long' but the argument type is 'unsigned long'. [invalidPrintfArgType_sint] tree-2.1.1/unix.c:72:22: style: Parameter 'error' can be declared as pointer to const [constParameterPointer] tree-2.1.1/xml.c:78:74: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable S_IRWXU [valueFlowBailoutIncompleteVar] tree-2.1.1/xml.c:172:3: warning: %ld in format string (no. 2) requires 'long' but the argument type is 'unsigned long'. [invalidPrintfArgType_sint] tree-2.1.1/xml.c:173:15: warning: %ld in format string (no. 2) requires 'long' but the argument type is 'unsigned long'. [invalidPrintfArgType_sint] tree-2.1.1/xml.c:67:33: style: Parameter 'ent' can be declared as pointer to const [constParameterPointer] tree-2.1.1/xml.c:147:21: style: Parameter 'error' can be declared as pointer to const [constParameterPointer] tree-2.1.1/xml.c:159:30: style: Parameter 'file' can be declared as pointer to const [constParameterPointer] diff: DONE