2024-04-13 09:32 ftp://ftp.de.debian.org/debian/pool/main/t/tcpser/tcpser_1.0rc12.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-102-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.13.0 head-info: 646f869 (2024-04-12 10:43:30 +0200) count: 86 59 elapsed-time: 3.6 3.7 head-timing-info: old-timing-info: head results: tcpser/src/bridge.c:28:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] tcpser/src/bridge.c:127:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] tcpser/src/bridge.c:178:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] tcpser/src/bridge.c:211:7: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable errno [valueFlowBailoutIncompleteVar] tcpser/src/bridge.c:225:7: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable errno [valueFlowBailoutIncompleteVar] tcpser/src/bridge.c:245:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] tcpser/src/bridge.c:266:16: style: Redundant initialization for 'last_cmd_mode'. The initialized value is overwritten before it is read. [redundantInitialization] tcpser/src/bridge.c:242:20: note: last_cmd_mode is initialized tcpser/src/bridge.c:266:16: note: last_cmd_mode is overwritten tcpser/src/bridge.c:122:10: style: Variable 'res' is assigned a value that is never used. [unreadVariable] tcpser/src/bridge.c:164:13: style: Variable 'res' is assigned a value that is never used. [unreadVariable] tcpser/src/bridge.c:235:13: style: Variable 'max_fd' is assigned a value that is never used. [unreadVariable] tcpser/src/bridge.c:237:10: style: Variable 'res' is assigned a value that is never used. [unreadVariable] tcpser/src/bridge.c:239:9: style: Variable 'rc' is assigned a value that is never used. [unreadVariable] tcpser/src/dce.c:21:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] tcpser/src/dce.c:38:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] tcpser/src/dce.c:66:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] tcpser/src/dce.c:103:26: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable TIOCM_DSR [valueFlowBailoutIncompleteVar] tcpser/src/dce.c:115:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] tcpser/src/dce.c:119:5: style: Obsolescent function 'usleep' called. It is recommended to use 'nanosleep' or 'setitimer' instead. [prohibitedusleepCalled] tcpser/src/dce.c:13:35: style: Parameter 'cfg' can be declared as pointer to const [constParameterPointer] tcpser/src/debug.c:17:12: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdout [valueFlowBailoutIncompleteVar] tcpser/src/debug.c:118:39: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] tcpser/src/debug.c:60:41: style: Parameter 'line' can be declared as pointer to const [constParameterPointer] tcpser/src/debug.c:61:8: style: Variable 'i' is assigned a value that is never used. [unreadVariable] tcpser/src/getcmd.c:135:12: style: Condition '0>getData(line,index,len,data_start,data_end,complex_parse)' is always false [knownConditionTrueFalse] tcpser/src/getcmd.c:135:21: note: Calling function 'getData' returns 0 tcpser/src/getcmd.c:135:12: note: Condition '0>getData(line,index,len,data_start,data_end,complex_parse)' is always false tcpser/src/getcmd.c:126:8: style: A pointer can not be negative so it is either pointless or an error to check if it is. [pointerLessThanZero] tcpser/src/getcmd.c:12:17: style:inconclusive: Function 'getData' argument 6 names different: declaration 'simple_parse' definition 'complex_parse'. [funcArgNamesDifferent] tcpser/src/getcmd.h:24:17: note: Function 'getData' argument 6 names different: declaration 'simple_parse' definition 'complex_parse'. tcpser/src/getcmd.c:12:17: note: Function 'getData' argument 6 names different: declaration 'simple_parse' definition 'complex_parse'. tcpser/src/getcmd.c:120:21: style:inconclusive: Function 'parseRegister' argument 8 names different: declaration 'simple_parse' definition 'complex_parse'. [funcArgNamesDifferent] tcpser/src/getcmd.h:47:21: note: Function 'parseRegister' argument 8 names different: declaration 'simple_parse' definition 'complex_parse'. tcpser/src/getcmd.c:120:21: note: Function 'parseRegister' argument 8 names different: declaration 'simple_parse' definition 'complex_parse'. tcpser/src/getcmd.c:7:27: style: Parameter 'line' can be declared as const array [constParameter] tcpser/src/getcmd.c:68:29: style: Parameter 'line' can be declared as const array [constParameter] tcpser/src/getcmd.c:81:24: style: Parameter 'line' can be declared as const array [constParameter] tcpser/src/init.c:9:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] tcpser/src/init.c:56:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] tcpser/src/init.c:116:13: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] tcpser/src/init.c:117:20: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] tcpser/src/init.c:8:32: style: Parameter 'name' can be declared as pointer to const [constParameterPointer] tcpser/src/ip.c:21:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] tcpser/src/ip.c:89:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] tcpser/src/ip.c:136:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] tcpser/src/ip.c:91:27: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] tcpser/src/ip.c:92:23: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] tcpser/src/ip.c:101:12: style: Obsolescent function 'gethostbyname' called. It is recommended to use 'getaddrinfo' instead. [prohibitedgethostbynameCalled] tcpser/src/ip.c:87:18: style: Variable 'tmp' can be declared as pointer to const [constVariablePointer] tcpser/src/ip.c:17:10: style: Variable 'on' is assigned a value that is never used. [unreadVariable] tcpser/src/ip.c:18:10: style: Variable 'rc' is assigned a value that is never used. [unreadVariable] tcpser/src/ip232.c:32:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] tcpser/src/ip232.c:81:7: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable errno [valueFlowBailoutIncompleteVar] tcpser/src/ip232.c:92:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] tcpser/src/ip232.c:134:15: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable TIOCM_DSR [valueFlowBailoutIncompleteVar] tcpser/src/ip232.c:146:20: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable TIOCM_DTR [valueFlowBailoutIncompleteVar] tcpser/src/ip232.c:211:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] tcpser/src/ip232.c:125:42: style: Parameter 'cfg' can be declared as pointer to const [constParameterPointer] tcpser/src/ip232.c:130:43: style: Parameter 'cfg' can be declared as pointer to const [constParameterPointer] tcpser/src/ip232.c:159:31: style: Parameter 'cfg' can be declared as pointer to const [constParameterPointer] tcpser/src/ip232.c:24:10: style: Variable 'res' is assigned a value that is never used. [unreadVariable] tcpser/src/ip232.c:28:13: style: Variable 'max_fd' is assigned a value that is never used. [unreadVariable] tcpser/src/ip232.c:49:13: style: Variable 'res' is assigned a value that is never used. [unreadVariable] tcpser/src/line.c:18:30: style: Parameter 'cfg' can be declared as pointer to const [constParameterPointer] tcpser/src/line.c:55:31: style: Parameter 'cfg' can be declared as pointer to const [constParameterPointer] tcpser/src/line.c:59:33: style: Parameter 'cfg' can be declared as pointer to const [constParameterPointer] tcpser/src/modem_core.c:262:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] tcpser/src/modem_core.c:296:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] tcpser/src/modem_core.c:275:7: style: Obsolescent function 'usleep' called. It is recommended to use 'nanosleep' or 'setitimer' instead. [prohibitedusleepCalled] tcpser/src/modem_core.c:350:25: style: Redundant assignment of 'cfg->dial_type' to itself. [selfAssignment] tcpser/src/modem_core.c:120:37: style: Parameter 'cfg' can be declared as pointer to const [constParameterPointer] tcpser/src/modem_core.c:125:37: style: Parameter 'cfg' can be declared as pointer to const [constParameterPointer] tcpser/src/modem_core.c:137:37: style: Parameter 'cfg' can be declared as pointer to const [constParameterPointer] tcpser/src/nvt.c:51:67: style: Parameter 'data' can be declared as pointer to const [constParameterPointer] tcpser/src/nvt.c:58:17: style: Variable 'tty_type' can be declared as const array [constVariable] tcpser/src/phone_book.c:16:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] tcpser/src/phone_book.c:37:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] tcpser/src/phone_book.c:15:27: style: Parameter 'from' can be declared as pointer to const [constParameterPointer] tcpser/src/phone_book.c:15:47: style: Parameter 'to' can be declared as pointer to const [constParameterPointer] tcpser/src/serial.c:13:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] tcpser/src/serial.c:80:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] tcpser/src/serial.c:123:5: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable errno [valueFlowBailoutIncompleteVar] tcpser/src/serial.c:140:20: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable TIOCMGET [valueFlowBailoutIncompleteVar] tcpser/src/serial.c:155:15: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable TIOCM_RTS [valueFlowBailoutIncompleteVar] tcpser/src/serial.c:152:8: style: Checking if unsigned expression 'status=ser_get_control_lines(fd)' is less than zero. [unsignedLessThanZero] tcpser/src/serial.c:75:34: style: Parameter 'tty' can be declared as pointer to const [constParameterPointer] tcpser/src/tcpmdm.c:38:5: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable errno [valueFlowBailoutIncompleteVar] tcpser/src/tcpmdm.c:26:13: style: Variable 'max_fd' is assigned a value that is never used. [unreadVariable] tcpser/src/tcpmdm.c:28:10: style: Variable 'res' is assigned a value that is never used. [unreadVariable] tcpser/src/tcpser.c:45:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] tcpser/src/tcpser.c:35:13: style: Variable 'max_fd' is assigned a value that is never used. [unreadVariable] tcpser/src/tcpser.c:38:10: style: Variable 'res' is assigned a value that is never used. [unreadVariable] tcpser/src/util.c:17:30: style: Parameter 'name' can be declared as pointer to const [constParameterPointer] diff: head tcpser/src/bridge.c:127:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] head tcpser/src/bridge.c:178:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] head tcpser/src/bridge.c:211:7: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable errno [valueFlowBailoutIncompleteVar] head tcpser/src/bridge.c:225:7: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable errno [valueFlowBailoutIncompleteVar] head tcpser/src/bridge.c:245:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] head tcpser/src/dce.c:103:26: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable TIOCM_DSR [valueFlowBailoutIncompleteVar] head tcpser/src/dce.c:115:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] head tcpser/src/dce.c:13:35: style: Parameter 'cfg' can be declared as pointer to const [constParameterPointer] head tcpser/src/dce.c:38:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] head tcpser/src/dce.c:66:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] head tcpser/src/init.c:56:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] head tcpser/src/ip.c:136:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] head tcpser/src/ip.c:89:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] head tcpser/src/ip232.c:125:42: style: Parameter 'cfg' can be declared as pointer to const [constParameterPointer] head tcpser/src/ip232.c:134:15: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable TIOCM_DSR [valueFlowBailoutIncompleteVar] head tcpser/src/ip232.c:146:20: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable TIOCM_DTR [valueFlowBailoutIncompleteVar] head tcpser/src/ip232.c:211:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] head tcpser/src/ip232.c:81:7: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable errno [valueFlowBailoutIncompleteVar] head tcpser/src/ip232.c:92:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] head tcpser/src/line.c:55:31: style: Parameter 'cfg' can be declared as pointer to const [constParameterPointer] head tcpser/src/line.c:59:33: style: Parameter 'cfg' can be declared as pointer to const [constParameterPointer] head tcpser/src/modem_core.c:120:37: style: Parameter 'cfg' can be declared as pointer to const [constParameterPointer] head tcpser/src/modem_core.c:296:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] head tcpser/src/modem_core.c:350:25: style: Redundant assignment of 'cfg->dial_type' to itself. [selfAssignment] 2.13.0 tcpser/src/modem_core.c:350:25: warning: Redundant assignment of 'cfg->dial_type' to itself. [selfAssignment] head tcpser/src/phone_book.c:37:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] head tcpser/src/serial.c:123:5: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable errno [valueFlowBailoutIncompleteVar] head tcpser/src/serial.c:140:20: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable TIOCMGET [valueFlowBailoutIncompleteVar] head tcpser/src/serial.c:155:15: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable TIOCM_RTS [valueFlowBailoutIncompleteVar] head tcpser/src/serial.c:80:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] 2.13.0 tcpser/src/tcpser.c:144:10: warning: Uninitialized variable: rc [uninitvar] tcpser/src/tcpser.c:59:12: note: Assuming condition is false tcpser/src/tcpser.c:144:10: note: Uninitialized variable: rc DONE