2024-03-25 23:20 ftp://ftp.de.debian.org/debian/pool/main/t/taskd/taskd_1.1.0+dfsg.orig.tar.xz cppcheck-options: --library=posix --library=gnu --showtime=top5 --check-library --inconclusive --enable=style,information --inline-suppr --disable=missingInclude --suppress=unmatchedSuppression --template=daca2 --debug-warnings --suppress=autoNoType --suppress=valueFlowBailout --suppress=bailoutUninitVar --suppress=symbolDatabaseWarning --suppress=valueFlowBailoutIncompleteVar -D__GNUC__ --platform=unix64 -j4 platform: Linux-6.1.0-0.deb11.6-amd64-x86_64-with-glibc2.31 python: 3.9.2 client-version: 1.3.45 compiler: g++ (Debian 10.2.1-6) 10.2.1 20210110 cppcheck: head 2.13.0 head-info: 82f05c8 (2024-03-25 22:58:58 +0100) count: 54 45 elapsed-time: 0.8 0.6 head-timing-info: Tokenizer::simplifyTokens1::ValueFlow: 0.578534s (avg. 0.578534s - 1 result(s)) valueFlowCondition(SymbolicConditionHandler{}, tokenlist, symboldatabase, errorLogger, settings, skippedFunctions): 0.505545s (avg. 0.252773s - 2 result(s)) valueFlowContainerSize(tokenlist, symboldatabase, errorLogger, settings, skippedFunctions): 0.023386s (avg. 0.011693s - 2 result(s)) valueFlowAfterAssign(tokenlist, symboldatabase, errorLogger, settings, skippedFunctions): 0.018282s (avg. 0.009141s - 2 result(s)) Tokenizer::simplifyTokens1::createSymbolDatabase: 0.014406s (avg. 0.014406s - 1 result(s)) Overall time: 0.620241s old-timing-info: Tokenizer::simplifyTokens1::ValueFlow: 0.483158s (avg. 0.483158s - 1 result(s)) valueFlowCondition(SymbolicConditionHandler{}, tokenlist, symboldatabase, errorLogger, settings, skippedFunctions): 0.423143s (avg. 0.211571s - 2 result(s)) valueFlowContainerSize(tokenlist, symboldatabase, errorLogger, settings, skippedFunctions): 0.025028s (avg. 0.012514s - 2 result(s)) valueFlowAfterAssign(tokenlist, symboldatabase, errorLogger, settings, skippedFunctions): 0.013809s (avg. 0.0069045s - 2 result(s)) Tokenizer::simplifyTokens1::createSymbolDatabase: 0.006584s (avg. 0.006584s - 1 result(s)) Overall time: 0.509208s head results: taskd-1.1.0+dfsg.orig/src/Color.cpp:41:7: style: struct member 'Anonymous0::index' is never used. [unusedStructMember] taskd-1.1.0+dfsg.orig/src/Directory.cpp:105:18: portability: Non reentrant function 'readdir' called. For threadsafe applications it is recommended to use the reentrant replacement function 'readdir_r'. [prohibitedreaddirCalled] taskd-1.1.0+dfsg.orig/src/Directory.cpp:209:18: portability: Non reentrant function 'readdir' called. For threadsafe applications it is recommended to use the reentrant replacement function 'readdir_r'. [prohibitedreaddirCalled] taskd-1.1.0+dfsg.orig/src/ConfigFile.cpp:127:14: performance: Ineffective call of function 'substr' because a prefix of the string is assigned to itself. Use resize() or pop_back() instead. [uselessCallsSubstr] taskd-1.1.0+dfsg.orig/src/Log.cpp:157:18: portability: Non reentrant function 'gmtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'gmtime_r'. [prohibitedgmtimeCalled] taskd-1.1.0+dfsg.orig/src/Path.cpp:242:27: portability: Non reentrant function 'getpwuid' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwuid_r'. [prohibitedgetpwuidCalled] taskd-1.1.0+dfsg.orig/src/Path.cpp:261:27: portability: Non reentrant function 'getpwnam' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwnam_r'. [prohibitedgetpwnamCalled] taskd-1.1.0+dfsg.orig/src/Path.cpp:242:22: style: Variable 'pw' can be declared as pointer to const [constVariablePointer] taskd-1.1.0+dfsg.orig/src/Server.cpp:359:3: warning: Return value of function freopen() is not used. [ignoredReturnValue] taskd-1.1.0+dfsg.orig/src/Server.cpp:360:3: warning: Return value of function freopen() is not used. [ignoredReturnValue] taskd-1.1.0+dfsg.orig/src/Server.cpp:361:3: warning: Return value of function freopen() is not used. [ignoredReturnValue] taskd-1.1.0+dfsg.orig/src/Nibbler.cpp:232:8: style: The scope of the variable 'current' can be reduced. [variableScope] taskd-1.1.0+dfsg.orig/src/Nibbler.cpp:232:16: style: Variable 'current' is assigned a value that is never used. [unreadVariable] taskd-1.1.0+dfsg.orig/src/Date.cpp:178:18: portability: Non reentrant function 'gmtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'gmtime_r'. [prohibitedgmtimeCalled] taskd-1.1.0+dfsg.orig/src/Date.cpp:208:18: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] taskd-1.1.0+dfsg.orig/src/Date.cpp:444:18: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] taskd-1.1.0+dfsg.orig/src/Date.cpp:465:18: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] taskd-1.1.0+dfsg.orig/src/Date.cpp:488:18: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] taskd-1.1.0+dfsg.orig/src/Date.cpp:581:18: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] taskd-1.1.0+dfsg.orig/src/Date.cpp:594:18: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] taskd-1.1.0+dfsg.orig/src/Date.cpp:601:18: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] taskd-1.1.0+dfsg.orig/src/Date.cpp:608:18: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] taskd-1.1.0+dfsg.orig/src/Date.cpp:615:18: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] taskd-1.1.0+dfsg.orig/src/Date.cpp:622:18: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] taskd-1.1.0+dfsg.orig/src/Date.cpp:208:14: style: Variable 't' can be declared as pointer to const [constVariablePointer] taskd-1.1.0+dfsg.orig/src/Date.cpp:488:14: style: Variable 't' can be declared as pointer to const [constVariablePointer] taskd-1.1.0+dfsg.orig/src/Date.cpp:581:14: style: Variable 't' can be declared as pointer to const [constVariablePointer] taskd-1.1.0+dfsg.orig/src/Date.cpp:601:14: style: Variable 't' can be declared as pointer to const [constVariablePointer] taskd-1.1.0+dfsg.orig/src/api.cpp:116:7: style: Condition '!taskd_at_least(message.get("version"),version)' is always false [knownConditionTrueFalse] taskd-1.1.0+dfsg.orig/src/api.cpp:116:24: note: Calling function 'taskd_at_least' returns 1 taskd-1.1.0+dfsg.orig/src/api.cpp:116:7: note: Condition '!taskd_at_least(message.get("version"),version)' is always false taskd-1.1.0+dfsg.orig/src/api.cpp:202:23: style: Variable 'error' can be declared as reference to const [constVariableReference] taskd-1.1.0+dfsg.orig/src/client.cpp:41:32: style: Parameter 'db' can be declared as reference to const [constParameterReference] taskd-1.1.0+dfsg.orig/src/admin.cpp:344:31: warning: Either the condition 'args.size()<1' is redundant or size of 'args' can be 1. Expression 'args[1]' causes access out of bounds. [containerOutOfBounds] taskd-1.1.0+dfsg.orig/src/admin.cpp:339:20: note: Assuming that condition 'args.size()<1' is not redundant taskd-1.1.0+dfsg.orig/src/admin.cpp:344:31: note: Access out of bounds taskd-1.1.0+dfsg.orig/src/config.cpp:57:17: warning: Opposite inner 'if' condition leads to a dead code block. [oppositeInnerCondition] taskd-1.1.0+dfsg.orig/src/config.cpp:54:20: note: outer condition: value=="" taskd-1.1.0+dfsg.orig/src/config.cpp:57:17: note: opposite inner condition: value!="" taskd-1.1.0+dfsg.orig/src/diag.cpp:136:13: style: Condition 'level==199711' is always false [knownConditionTrueFalse] taskd-1.1.0+dfsg.orig/src/diag.cpp:135:15: note: Assignment 'level=202302L', assigned value is 202302 taskd-1.1.0+dfsg.orig/src/diag.cpp:136:13: note: Condition 'level==199711' is always false taskd-1.1.0+dfsg.orig/src/diag.cpp:138:18: style: Condition 'level==201103' is always false [knownConditionTrueFalse] taskd-1.1.0+dfsg.orig/src/diag.cpp:135:15: note: Assignment 'level=202302L', assigned value is 202302 taskd-1.1.0+dfsg.orig/src/diag.cpp:138:18: note: Condition 'level==201103' is always false taskd-1.1.0+dfsg.orig/src/diag.cpp:269:34: style: Parameter 'config' can be declared as reference to const [constParameterReference] taskd-1.1.0+dfsg.orig/src/status.cpp:81:32: style: Parameter 'db' can be declared as reference to const [constParameterReference] taskd-1.1.0+dfsg.orig/src/daemon.cpp:62:3: style: Class 'Daemon' has a constructor with 1 argument that is not explicit. [noExplicitConstructor] taskd-1.1.0+dfsg.orig/src/daemon.cpp:419:7: style: Consider using std::find_if algorithm instead of a raw loop. [useStlAlgorithm] taskd-1.1.0+dfsg.orig/src/util.cpp:257:9: style: Variable 'tz' can be declared as pointer to const [constVariablePointer] taskd-1.1.0+dfsg.orig/src/wcwidth6.cpp:73:7: style: The scope of the variable 'mid' can be reduced. [variableScope] taskd-1.1.0+dfsg.orig/src/wcwidth6.cpp:244:7: style: The scope of the variable 'w' can be reduced. [variableScope] taskd-1.1.0+dfsg.orig/src/text.cpp:181:12: style: Local variable 'i' shadows outer variable [shadowVariable] taskd-1.1.0+dfsg.orig/src/text.cpp:180:7: note: Shadowed declaration taskd-1.1.0+dfsg.orig/src/text.cpp:181:12: note: Shadow variable taskd-1.1.0+dfsg.orig/src/text.cpp:242:12: style: Local variable 'i' shadows outer variable [shadowVariable] taskd-1.1.0+dfsg.orig/src/text.cpp:180:7: note: Shadowed declaration taskd-1.1.0+dfsg.orig/src/text.cpp:242:12: note: Shadow variable taskd-1.1.0+dfsg.orig/test/json.t.cpp:132:14: style: C-style pointer casting [cstyleCast] taskd-1.1.0+dfsg.orig/src/Task.cpp:584:30: style: C-style pointer casting [cstyleCast] taskd-1.1.0+dfsg.orig/src/Task.cpp:622:31: style: C-style pointer casting [cstyleCast] taskd-1.1.0+dfsg.orig/src/Task.cpp:636:31: style: C-style pointer casting [cstyleCast] taskd-1.1.0+dfsg.orig/src/Task.cpp:658:31: style: C-style pointer casting [cstyleCast] taskd-1.1.0+dfsg.orig/src/Task.cpp:665:34: style: C-style pointer casting [cstyleCast] taskd-1.1.0+dfsg.orig/src/Task.cpp:666:34: style: C-style pointer casting [cstyleCast] taskd-1.1.0+dfsg.orig/src/Task.cpp:918:43: style: Local variable 'i' shadows outer variable [shadowVariable] taskd-1.1.0+dfsg.orig/src/Task.cpp:868:24: note: Shadowed declaration taskd-1.1.0+dfsg.orig/src/Task.cpp:918:43: note: Shadow variable taskd-1.1.0+dfsg.orig/test/text.t.cpp:222:20: style: Variable 'text' is assigned a value that is never used. [unreadVariable] taskd-1.1.0+dfsg.orig/src/Task.cpp:1027:7: performance: Prefer prefix ++/-- operators for non-primitive types. [postfixOperator] diff: head taskd-1.1.0+dfsg.orig/src/Task.cpp:584:30: style: C-style pointer casting [cstyleCast] head taskd-1.1.0+dfsg.orig/src/Task.cpp:622:31: style: C-style pointer casting [cstyleCast] head taskd-1.1.0+dfsg.orig/src/Task.cpp:636:31: style: C-style pointer casting [cstyleCast] head taskd-1.1.0+dfsg.orig/src/Task.cpp:658:31: style: C-style pointer casting [cstyleCast] head taskd-1.1.0+dfsg.orig/src/Task.cpp:665:34: style: C-style pointer casting [cstyleCast] head taskd-1.1.0+dfsg.orig/src/Task.cpp:666:34: style: C-style pointer casting [cstyleCast] 2.13.0 taskd-1.1.0+dfsg.orig/src/admin.cpp:344:31: warning: Either the condition 'args.size()<1' is redundant or args size can be 1. Expression 'args[1]' cause access out of bounds. [containerOutOfBounds] taskd-1.1.0+dfsg.orig/src/admin.cpp:339:20: note: Assuming that condition 'args.size()<1' is not redundant taskd-1.1.0+dfsg.orig/src/admin.cpp:344:31: note: Access out of bounds head taskd-1.1.0+dfsg.orig/src/admin.cpp:344:31: warning: Either the condition 'args.size()<1' is redundant or size of 'args' can be 1. Expression 'args[1]' causes access out of bounds. [containerOutOfBounds] taskd-1.1.0+dfsg.orig/src/admin.cpp:339:20: note: Assuming that condition 'args.size()<1' is not redundant taskd-1.1.0+dfsg.orig/src/admin.cpp:344:31: note: Access out of bounds head taskd-1.1.0+dfsg.orig/src/client.cpp:41:32: style: Parameter 'db' can be declared as reference to const [constParameterReference] head taskd-1.1.0+dfsg.orig/src/diag.cpp:269:34: style: Parameter 'config' can be declared as reference to const [constParameterReference] head taskd-1.1.0+dfsg.orig/src/status.cpp:81:32: style: Parameter 'db' can be declared as reference to const [constParameterReference] DONE