2024-03-26 05:11 ftp://ftp.de.debian.org/debian/pool/main/w/whowatch/whowatch_1.8.6.orig.tar.gz cppcheck-options: --library=posix --library=gnu --library=bsd --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 -j4 platform: Linux-6.1.0-18-amd64-x86_64-with-glibc2.36 python: 3.11.2 client-version: 1.3.55 compiler: g++ (Debian 12.2.0-14) 12.2.0 cppcheck: head 2.13.0 head-info: 82f05c8 (2024-03-25 22:58:58 +0100) count: 79 55 elapsed-time: 0.3 0.2 head-timing-info: old-timing-info: head results: whowatch-1.8.6/src/block.c:64:9: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable head [valueFlowBailoutIncompleteVar] whowatch-1.8.6/src/block.c:107:9: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable head [valueFlowBailoutIncompleteVar] whowatch-1.8.6/src/owner.c:46:6: portability: Non reentrant function 'getpwuid' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwuid_r'. [prohibitedgetpwuidCalled] whowatch-1.8.6/src/owner.c:45:9: warning: Either the condition '!p' is redundant or there is possible null pointer dereference: p. [nullPointerRedundantCheck] whowatch-1.8.6/src/owner.c:44:6: note: Assuming that condition '!p' is not redundant whowatch-1.8.6/src/owner.c:45:9: note: Null pointer dereference whowatch-1.8.6/src/exti.c:8:27: style: Parameter 'p' can be declared as pointer to const. However it seems that 'siglist' is a callback function, if 'p' is declared with const you might also need to cast function pointer(s). [constParameterCallback] whowatch-1.8.6/src/exti.c:20:57: note: You might need to cast the function pointer here whowatch-1.8.6/src/exti.c:8:27: note: Parameter 'p' can be declared as pointer to const whowatch-1.8.6/src/list.h:75:52: style: Parameter 'head' can be declared as pointer to const [constParameterPointer] whowatch-1.8.6/src/owner.c:42:17: style: Variable 'u' can be declared as pointer to const [constVariablePointer] whowatch-1.8.6/src/owner.c:59:16: style: Variable 'p' can be declared as pointer to const [constVariablePointer] whowatch-1.8.6/src/block.c:101:22: style: Parameter 'p' can be declared as pointer to const [constParameterPointer] whowatch-1.8.6/src/block.c:75:23: portability: 'tmp->_block_t' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] whowatch-1.8.6/src/block.c:108:47: portability: 'tmp->_block_t' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] whowatch-1.8.6/src/proc_plugin.c:30:0: error: #error Could not determine ticks per second [preprocessorErrorDirective] whowatch-1.8.6/src/pluglib.c:41:30: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable A_BOLD [valueFlowBailoutIncompleteVar] whowatch-1.8.6/src/pluglib.c:46:30: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable A_NORMAL [valueFlowBailoutIncompleteVar] whowatch-1.8.6/src/pluglib.c:29:4: style: Variable 'n' is assigned a value that is never used. [unreadVariable] whowatch-1.8.6/src/pluglib.c:56:4: style: Variable 'n' is assigned a value that is never used. [unreadVariable] whowatch-1.8.6/src/procinfo.c:201:21: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable O_RDONLY [valueFlowBailoutIncompleteVar] whowatch-1.8.6/src/procinfo.c:312:24: style: Parameter 'tty' can be declared as pointer to const [constParameterPointer] whowatch-1.8.6/src/proctree.c:59:5: portability: Non reentrant function 'readdir' called. For threadsafe applications it is recommended to use the reentrant replacement function 'readdir_r'. [prohibitedreaddirCalled] whowatch-1.8.6/src/screen.c:102:20: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable A_NORMAL [valueFlowBailoutIncompleteVar] whowatch-1.8.6/src/screen.c:112:41: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable A_REVERSE [valueFlowBailoutIncompleteVar] whowatch-1.8.6/src/screen.c:395:17: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable ICANON [valueFlowBailoutIncompleteVar] whowatch-1.8.6/src/screen.c:403:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable F_SETFL [valueFlowBailoutIncompleteVar] whowatch-1.8.6/src/proctree.c:59:13: warning: Either the condition 'd<0' is redundant or there is possible null pointer dereference: d. [nullPointerRedundantCheck] whowatch-1.8.6/src/proctree.c:180:6: note: Assuming that condition 'd<0' is not redundant whowatch-1.8.6/src/proctree.c:182:25: note: Calling function 'get_pinfo', 2nd argument 'd' value is 0 whowatch-1.8.6/src/proctree.c:59:13: note: Null pointer dereference whowatch-1.8.6/src/proctree.c:180:6: style: A pointer can not be negative so it is either pointless or an error to check if it is. [pointerLessThanZero] whowatch-1.8.6/src/proctree.c:93:32: style:inconclusive: Function 'find_by_pid' argument 1 names different: declaration 'pid' definition 'n'. [funcArgNamesDifferent] whowatch-1.8.6/src/proctree.h:23:32: note: Function 'find_by_pid' argument 1 names different: declaration 'pid' definition 'n'. whowatch-1.8.6/src/proctree.c:93:32: note: Function 'find_by_pid' argument 1 names different: declaration 'pid' definition 'n'. whowatch-1.8.6/src/proctree.c:216:31: style:inconclusive: Function 'tree_start' argument 1 names different: declaration 'root' definition 'root_pid'. [funcArgNamesDifferent] whowatch-1.8.6/src/proctree.h:24:31: note: Function 'tree_start' argument 1 names different: declaration 'root' definition 'root_pid'. whowatch-1.8.6/src/proctree.c:216:31: note: Function 'tree_start' argument 1 names different: declaration 'root' definition 'root_pid'. whowatch-1.8.6/src/proctree.c:216:45: style:inconclusive: Function 'tree_start' argument 2 names different: declaration 'start' definition 'start_pid'. [funcArgNamesDifferent] whowatch-1.8.6/src/proctree.h:24:41: note: Function 'tree_start' argument 2 names different: declaration 'start' definition 'start_pid'. whowatch-1.8.6/src/proctree.c:216:45: note: Function 'tree_start' argument 2 names different: declaration 'start' definition 'start_pid'. whowatch-1.8.6/src/proctree.c:245:44: style:inconclusive: Function 'tree_string' argument 2 names different: declaration 'proc' definition 'p'. [funcArgNamesDifferent] whowatch-1.8.6/src/proctree.h:26:44: note: Function 'tree_string' argument 2 names different: declaration 'proc' definition 'p'. whowatch-1.8.6/src/proctree.c:245:44: note: Function 'tree_string' argument 2 names different: declaration 'proc' definition 'p'. whowatch-1.8.6/src/proctree.c:57:8: style: Local variable 'buf' shadows outer variable [shadowVariable] whowatch-1.8.6/src/proctree.c:243:13: note: Shadowed declaration whowatch-1.8.6/src/proctree.c:57:8: note: Shadow variable whowatch-1.8.6/src/proctree.c:53:17: style: Variable 'e' can be declared as pointer to const [constVariablePointer] whowatch-1.8.6/src/proctree.c:57:17: style: Variable 'p' can be declared as pointer to const [constVariablePointer] whowatch-1.8.6/src/ulist.c:43:7: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable head [valueFlowBailoutIncompleteVar] whowatch-1.8.6/src/ulist.c:58:35: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable UT_NAMESIZE [valueFlowBailoutIncompleteVar] whowatch-1.8.6/src/ulist.c:85:18: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable A_BOLD [valueFlowBailoutIncompleteVar] whowatch-1.8.6/src/ulist.c:99:7: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable head [valueFlowBailoutIncompleteVar] whowatch-1.8.6/src/ulist.c:115:28: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable O_RDONLY [valueFlowBailoutIncompleteVar] whowatch-1.8.6/src/ulist.c:139:7: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable head [valueFlowBailoutIncompleteVar] whowatch-1.8.6/src/ulist.c:167:33: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable O_RDONLY [valueFlowBailoutIncompleteVar] whowatch-1.8.6/src/ulist.c:202:8: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable head [valueFlowBailoutIncompleteVar] whowatch-1.8.6/src/ulist.c:256:7: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable head [valueFlowBailoutIncompleteVar] whowatch-1.8.6/src/plist.c:322:2: style: Obsolescent function 'bzero' called. It is recommended to use 'memset' instead. [prohibitedbzeroCalled] whowatch-1.8.6/src/plist.c:23:6: warning: Either the condition '!z' is redundant or there is possible null pointer dereference: p. [nullPointerRedundantCheck] whowatch-1.8.6/src/plist.c:93:7: note: Assuming that condition '!z' is not redundant whowatch-1.8.6/src/plist.c:101:16: note: Calling function 'pstat_update', 1st argument 'z' value is 0 whowatch-1.8.6/src/plist.c:23:6: note: Null pointer dereference whowatch-1.8.6/src/plist.c:96:10: warning: Either the condition '!z' is redundant or there is possible null pointer dereference: z. [nullPointerRedundantCheck] whowatch-1.8.6/src/plist.c:93:7: note: Assuming that condition '!z' is not redundant whowatch-1.8.6/src/plist.c:96:10: note: Null pointer dereference whowatch-1.8.6/src/plist.c:98:3: warning: Either the condition '!z' is redundant or there is possible null pointer dereference: z. [nullPointerRedundantCheck] whowatch-1.8.6/src/plist.c:93:7: note: Assuming that condition '!z' is not redundant whowatch-1.8.6/src/plist.c:98:3: note: Null pointer dereference whowatch-1.8.6/src/plist.c:100:3: warning: Either the condition '!z' is redundant or there is possible null pointer dereference: z. [nullPointerRedundantCheck] whowatch-1.8.6/src/plist.c:93:7: note: Assuming that condition '!z' is not redundant whowatch-1.8.6/src/plist.c:100:3: note: Null pointer dereference whowatch-1.8.6/src/plist.c:146:22: warning: Either the condition '!p' is redundant or there is possible null pointer dereference: p. [nullPointerRedundantCheck] whowatch-1.8.6/src/plist.c:148:6: note: Assuming that condition '!p' is not redundant whowatch-1.8.6/src/plist.c:146:22: note: Null pointer dereference whowatch-1.8.6/src/plist.c:311:8: style: Redundant assignment of 'w->vy' to itself. [selfAssignment] whowatch-1.8.6/src/plist.c:20:42: style: Parameter 'p' can be declared as pointer to const [constParameterPointer] whowatch-1.8.6/src/plist.c:138:14: style: Variable 'm' can be declared as const array [constVariable] whowatch-1.8.6/src/plist.c:138:28: style: Variable 'c' can be declared as const array [constVariable] whowatch-1.8.6/src/plist.c:139:8: style: Variable 's' can be declared as pointer to const [constVariablePointer] whowatch-1.8.6/src/plist.c:146:8: style: Variable 'tree' can be declared as pointer to const [constVariablePointer] whowatch-1.8.6/src/plist.c:177:8: style: Variable 'tmp' can be declared as pointer to const [constVariablePointer] whowatch-1.8.6/src/user_plugin.c:21:7: portability: Non reentrant function 'getpwnam' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwnam_r'. [prohibitedgetpwnamCalled] whowatch-1.8.6/src/plist.c:211:17: style: Variable 'n' is assigned a value that is never used. [unreadVariable] whowatch-1.8.6/src/user_plugin.c:14:18: style: Parameter 'p' can be declared as pointer to const [constParameterPointer] whowatch-1.8.6/src/screen.c:262:40: style: Parameter 'w' can be declared as pointer to const [constParameterPointer] whowatch-1.8.6/src/wdgts.c:13:37: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable REG_NOTEOL [valueFlowBailoutIncompleteVar] whowatch-1.8.6/src/wdgts.c:22:29: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable REG_EXTENDED [valueFlowBailoutIncompleteVar] whowatch-1.8.6/src/wdgts.c:74:51: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable A_CHARTEXT [valueFlowBailoutIncompleteVar] whowatch-1.8.6/src/wdgts.c:170:18: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable A_BOLD [valueFlowBailoutIncompleteVar] whowatch-1.8.6/src/ulist.c:116:18: warning: Either the condition '(fd=open("/var/run/utmp",O_RDONLY))==-1' is redundant or read() argument nr 1 can have invalid value. The value is -1 but the valid values are '0:'. [invalidFunctionArg] whowatch-1.8.6/src/ulist.c:115:39: note: Assuming that condition '(fd=open("/var/run/utmp",O_RDONLY))==-1' is not redundant whowatch-1.8.6/src/ulist.c:116:18: note: Invalid argument whowatch-1.8.6/src/wdgts.c:16:44: style: Parameter 's' can be declared as pointer to const [constParameterPointer] whowatch-1.8.6/src/ulist.c:23:27: style: Parameter 'name' can be declared as pointer to const [constParameterPointer] whowatch-1.8.6/src/ulist.c:51:40: style: Parameter 'entry' can be declared as pointer to const [constParameterPointer] whowatch-1.8.6/src/ulist.c:113:17: style: Variable 'u' can be declared as pointer to const [constVariablePointer] whowatch-1.8.6/src/whowatch.c:35:1: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable wdgts_l [valueFlowBailoutIncompleteVar] whowatch-1.8.6/src/whowatch.c:36:1: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable wdgts_l [valueFlowBailoutIncompleteVar] whowatch-1.8.6/src/whowatch.c:43:7: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable wdgts_l [valueFlowBailoutIncompleteVar] whowatch-1.8.6/src/whowatch.c:62:7: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable msg_l [valueFlowBailoutIncompleteVar] whowatch-1.8.6/src/whowatch.c:82:7: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable wdgts_l [valueFlowBailoutIncompleteVar] whowatch-1.8.6/src/whowatch.c:121:10: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] whowatch-1.8.6/src/whowatch.c:182:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable TIOCGWINSZ [valueFlowBailoutIncompleteVar] whowatch-1.8.6/src/whowatch.c:203:7: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable wdgts_l [valueFlowBailoutIncompleteVar] whowatch-1.8.6/src/whowatch.c:181:17: style: Local variable 'win' shadows outer variable [shadowVariable] whowatch-1.8.6/src/whowatch.c:8:19: note: Shadowed declaration whowatch-1.8.6/src/whowatch.c:181:17: note: Shadow variable whowatch-1.8.6/src/whowatch.c:107:30: style: Parameter 's' can be declared as pointer to const [constParameterPointer] whowatch-1.8.6/src/whowatch.c:112:21: style: Parameter 's' can be declared as pointer to const [constParameterPointer] whowatch-1.8.6/src/whowatch.c:273:96: style: Parameter 'name' can be declared as pointer to const [constParameterPointer] diff: head whowatch-1.8.6/src/block.c:107:9: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable head [valueFlowBailoutIncompleteVar] head whowatch-1.8.6/src/exti.c:8:27: style: Parameter 'p' can be declared as pointer to const. However it seems that 'siglist' is a callback function, if 'p' is declared with const you might also need to cast function pointer(s). [constParameterCallback] whowatch-1.8.6/src/exti.c:20:57: note: You might need to cast the function pointer here whowatch-1.8.6/src/exti.c:8:27: note: Parameter 'p' can be declared as pointer to const head whowatch-1.8.6/src/plist.c:311:8: style: Redundant assignment of 'w->vy' to itself. [selfAssignment] 2.13.0 whowatch-1.8.6/src/plist.c:311:8: warning: Redundant assignment of 'w->vy' to itself. [selfAssignment] head whowatch-1.8.6/src/pluglib.c:46:30: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable A_NORMAL [valueFlowBailoutIncompleteVar] head whowatch-1.8.6/src/screen.c:112:41: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable A_REVERSE [valueFlowBailoutIncompleteVar] head whowatch-1.8.6/src/screen.c:395:17: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable ICANON [valueFlowBailoutIncompleteVar] head whowatch-1.8.6/src/screen.c:403:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable F_SETFL [valueFlowBailoutIncompleteVar] head whowatch-1.8.6/src/ulist.c:115:28: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable O_RDONLY [valueFlowBailoutIncompleteVar] head whowatch-1.8.6/src/ulist.c:139:7: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable head [valueFlowBailoutIncompleteVar] head whowatch-1.8.6/src/ulist.c:167:33: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable O_RDONLY [valueFlowBailoutIncompleteVar] head whowatch-1.8.6/src/ulist.c:202:8: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable head [valueFlowBailoutIncompleteVar] head whowatch-1.8.6/src/ulist.c:256:7: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable head [valueFlowBailoutIncompleteVar] head whowatch-1.8.6/src/ulist.c:58:35: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable UT_NAMESIZE [valueFlowBailoutIncompleteVar] head whowatch-1.8.6/src/ulist.c:85:18: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable A_BOLD [valueFlowBailoutIncompleteVar] head whowatch-1.8.6/src/ulist.c:99:7: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable head [valueFlowBailoutIncompleteVar] head whowatch-1.8.6/src/wdgts.c:170:18: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable A_BOLD [valueFlowBailoutIncompleteVar] head whowatch-1.8.6/src/wdgts.c:22:29: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable REG_EXTENDED [valueFlowBailoutIncompleteVar] head whowatch-1.8.6/src/wdgts.c:74:51: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable A_CHARTEXT [valueFlowBailoutIncompleteVar] head whowatch-1.8.6/src/whowatch.c:121:10: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] head whowatch-1.8.6/src/whowatch.c:182:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable TIOCGWINSZ [valueFlowBailoutIncompleteVar] head whowatch-1.8.6/src/whowatch.c:203:7: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable wdgts_l [valueFlowBailoutIncompleteVar] head whowatch-1.8.6/src/whowatch.c:36:1: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable wdgts_l [valueFlowBailoutIncompleteVar] head whowatch-1.8.6/src/whowatch.c:43:7: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable wdgts_l [valueFlowBailoutIncompleteVar] head whowatch-1.8.6/src/whowatch.c:62:7: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable msg_l [valueFlowBailoutIncompleteVar] head whowatch-1.8.6/src/whowatch.c:82:7: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable wdgts_l [valueFlowBailoutIncompleteVar] DONE