2024-04-24 18:53 ftp://ftp.de.debian.org/debian/pool/main/g/gcpegg/gcpegg_5.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 --suppress=normalCheckLevelConditionExpressions -D__GNUC__ --platform=unix64 -j4 platform: Linux-6.6.25_1-x86_64-with-libc python: 3.12.3 client-version: 1.3.57 compiler: g++ (GCC) 13.2.0 cppcheck: head 2.14.0 head-info: 94f28a2 (2024-04-24 20:47:54 +0200) count: 124 124 elapsed-time: 6.1 6.1 head-timing-info: old-timing-info: head results: gcpegg-5.1.orig/eggui.c:70:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdscr [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/eggui.c:100:24: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable ERR [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/examine.c:36:23: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdin [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/examine.c:49:7: portability: %ld in format string (no. 2) requires 'long' but the argument type is 'uint32 {aka unsigned long}'. [invalidPrintfArgType_sint] gcpegg-5.1.orig/hw_pear.c:94:24: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable B1200 [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/hw_pear.c:189:40: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable errno [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/genlib.c:70:57: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable utsname [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/genlib.c:113:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/genlib.c:234:22: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable AF_INET [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/hw_pear.c:104:5: portability: %ld in format string (no. 2) requires 'long' but the argument type is 'uint32 {aka unsigned long}'. [invalidPrintfArgType_sint] gcpegg-5.1.orig/hw_pear.c:108:3: portability: %ld in format string (no. 2) requires 'long' but the argument type is 'uint32 {aka unsigned long}'. [invalidPrintfArgType_sint] gcpegg-5.1.orig/hw_pear.c:129:7: style: Variable 'res' is reassigned a value before the old one has been used. [redundantAssignment] gcpegg-5.1.orig/hw_pear.c:120:7: note: res is assigned gcpegg-5.1.orig/hw_pear.c:129:7: note: res is overwritten gcpegg-5.1.orig/hw_pear.c:133:7: style: Variable 'res' is reassigned a value before the old one has been used. [redundantAssignment] gcpegg-5.1.orig/hw_pear.c:129:7: note: res is assigned gcpegg-5.1.orig/hw_pear.c:133:7: note: res is overwritten gcpegg-5.1.orig/genlib.c:195:8: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] gcpegg-5.1.orig/genlib.c:199:10: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] gcpegg-5.1.orig/genlib.c:218:8: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] gcpegg-5.1.orig/genlib.c:221:10: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] gcpegg-5.1.orig/genlib.c:226:10: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] gcpegg-5.1.orig/genlib.c:228:12: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] gcpegg-5.1.orig/hw_pear.c:56:24: style: Parameter 'opts' can be declared as pointer to const [constParameterPointer] gcpegg-5.1.orig/genlib.c:113:5: portability: %d in format string (no. 2) requires 'int' but the argument type is 'ptrdiff_t {aka signed int}'. [invalidPrintfArgType_sint] gcpegg-5.1.orig/hw_pear.c:133:7: style: Variable 'res' is assigned a value that is never used. [unreadVariable] gcpegg-5.1.orig/hw_pear.c:160:10: style: Variable 'samp' is assigned a value that is never used. [unreadVariable] gcpegg-5.1.orig/genlib.c:55:31: style: Parameter 'tv1' can be declared as pointer to const [constParameterPointer] gcpegg-5.1.orig/genlib.c:55:52: style: Parameter 'tv2' can be declared as pointer to const [constParameterPointer] gcpegg-5.1.orig/genlib.c:63:9: style: Variable 'idstr' can be declared as pointer to const [constVariablePointer] gcpegg-5.1.orig/genlib.c:203:22: style: Parameter 'input' can be declared as pointer to const [constParameterPointer] gcpegg-5.1.orig/genlib.c:212:9: style: Variable 'tp' can be declared as pointer to const [constVariablePointer] gcpegg-5.1.orig/genlib.c:239:42: style: Parameter 'sinp' can be declared as pointer to const [constParameterPointer] gcpegg-5.1.orig/ipproto.c:28:20: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable reclen [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/ipproto.c:19:56: style: Parameter 'cart' can be declared as pointer to const [constParameterPointer] gcpegg-5.1.orig/basket.c:112:25: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/basket.c:307:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/basket.c:494:17: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/basket.c:633:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/basket.c:809:23: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/basket.c:823:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/reg_orion.c:104:24: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable B1200 [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/reg_orion.c:210:40: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable errno [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/reg_orion.c:283:15: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable TCIFLUSH [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/network.c:85:33: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable sockaddr_in [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/network.c:171:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/network.c:218:19: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable FD_SETSIZE [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/network.c:347:21: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable sockaddr [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/network.c:273:26: portability: Undefined behaviour, when 'count-2' is -2 the pointer arithmetic 'buffer+(count-2)' is out of bounds. [pointerOutOfBoundsCond] gcpegg-5.1.orig/network.c:241:13: note: Assuming that condition 'count<0' is not redundant gcpegg-5.1.orig/network.c:273:26: note: Pointer arithmetic overflow gcpegg-5.1.orig/network.c:79:13: portability: Non reentrant function 'getprotobyname' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getprotobyname_r'. [prohibitedgetprotobynameCalled] gcpegg-5.1.orig/network.c:102:15: style: Obsolescent function 'gethostbyname' called. It is recommended to use 'getaddrinfo' instead. [prohibitedgethostbynameCalled] gcpegg-5.1.orig/network.c:170:13: style: Obsolescent function 'gethostbyname' called. It is recommended to use 'getaddrinfo' instead. [prohibitedgethostbynameCalled] gcpegg-5.1.orig/network.c:334:15: portability: Non reentrant function 'getprotobyname' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getprotobyname_r'. [prohibitedgetprotobynameCalled] gcpegg-5.1.orig/reg_orion.c:114:5: portability: %ld in format string (no. 2) requires 'long' but the argument type is 'uint32 {aka unsigned long}'. [invalidPrintfArgType_sint] gcpegg-5.1.orig/reg_orion.c:118:3: portability: %ld in format string (no. 2) requires 'long' but the argument type is 'uint32 {aka unsigned long}'. [invalidPrintfArgType_sint] gcpegg-5.1.orig/reg_orion.c:148:7: style: Variable 'res' is reassigned a value before the old one has been used. [redundantAssignment] gcpegg-5.1.orig/reg_orion.c:135:7: note: res is assigned gcpegg-5.1.orig/reg_orion.c:148:7: note: res is overwritten gcpegg-5.1.orig/reg_orion.c:152:7: style: Variable 'res' is reassigned a value before the old one has been used. [redundantAssignment] gcpegg-5.1.orig/reg_orion.c:148:7: note: res is assigned gcpegg-5.1.orig/reg_orion.c:152:7: note: res is overwritten gcpegg-5.1.orig/reg_orion.c:77:31: style: Parameter 'opts' can be declared as pointer to const. However it seems that 'OpenDev' is a callback function, if 'opts' is declared with const you might also need to cast function pointer(s). [constParameterCallback] gcpegg-5.1.orig/reg_orion.c:301:4: note: You might need to cast the function pointer here gcpegg-5.1.orig/reg_orion.c:77:31: note: Parameter 'opts' can be declared as pointer to const gcpegg-5.1.orig/network.c:72:20: style: Variable 'pp' can be declared as pointer to const [constVariablePointer] gcpegg-5.1.orig/network.c:73:19: style: Variable 'hp' can be declared as pointer to const [constVariablePointer] gcpegg-5.1.orig/network.c:142:19: style: Parameter 'cmd' can be declared as pointer to const [constParameterPointer] gcpegg-5.1.orig/network.c:155:19: style: Parameter 'cmd' can be declared as pointer to const [constParameterPointer] gcpegg-5.1.orig/network.c:167:47: style: Parameter 'host' can be declared as pointer to const [constParameterPointer] gcpegg-5.1.orig/network.c:168:19: style: Variable 'hp' can be declared as pointer to const [constVariablePointer] gcpegg-5.1.orig/network.c:317:33: style: Parameter 'sin' can be declared as pointer to const [constParameterPointer] gcpegg-5.1.orig/network.c:79:11: style: Variable 'pp' is assigned a value that is never used. [unreadVariable] gcpegg-5.1.orig/network.c:291:13: style: Variable 'pkttype' is assigned a value that is never used. [unreadVariable] gcpegg-5.1.orig/reg_orion.c:152:7: style: Variable 'res' is assigned a value that is never used. [unreadVariable] gcpegg-5.1.orig/reg_orion.c:258:10: style: Variable 'samp' is assigned a value that is never used. [unreadVariable] gcpegg-5.1.orig/reg_pear.c:84:24: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable B1200 [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/reg_pear.c:149:40: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable errno [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/reg_pear.c:209:15: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable TCIFLUSH [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/reg_pseudo.c:105:10: style: Variable 'samp' is assigned a value that is never used. [unreadVariable] gcpegg-5.1.orig/reg_pear.c:94:5: portability: %ld in format string (no. 2) requires 'long' but the argument type is 'uint32 {aka unsigned long}'. [invalidPrintfArgType_sint] gcpegg-5.1.orig/reg_pear.c:98:3: portability: %ld in format string (no. 2) requires 'long' but the argument type is 'uint32 {aka unsigned long}'. [invalidPrintfArgType_sint] gcpegg-5.1.orig/reg_pear.c:123:7: style: Variable 'res' is reassigned a value before the old one has been used. [redundantAssignment] gcpegg-5.1.orig/reg_pear.c:114:7: note: res is assigned gcpegg-5.1.orig/reg_pear.c:123:7: note: res is overwritten gcpegg-5.1.orig/reg_pear.c:127:7: style: Variable 'res' is reassigned a value before the old one has been used. [redundantAssignment] gcpegg-5.1.orig/reg_pear.c:123:7: note: res is assigned gcpegg-5.1.orig/reg_pear.c:127:7: note: res is overwritten gcpegg-5.1.orig/regtest.c:39:21: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable B1200 [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/regtest.c:96:40: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable errno [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/reg_pear.c:57:31: style: Parameter 'opts' can be declared as pointer to const. However it seems that 'OpenDev' is a callback function, if 'opts' is declared with const you might also need to cast function pointer(s). [constParameterCallback] gcpegg-5.1.orig/reg_pear.c:227:4: note: You might need to cast the function pointer here gcpegg-5.1.orig/reg_pear.c:57:31: note: Parameter 'opts' can be declared as pointer to const gcpegg-5.1.orig/reg_pear.c:127:7: style: Variable 'res' is assigned a value that is never used. [unreadVariable] gcpegg-5.1.orig/reg_pear.c:184:10: style: Variable 'samp' is assigned a value that is never used. [unreadVariable] gcpegg-5.1.orig/regtest.c:57:7: style: Variable 'res' is reassigned a value before the old one has been used. [redundantAssignment] gcpegg-5.1.orig/regtest.c:56:7: note: res is assigned gcpegg-5.1.orig/regtest.c:57:7: note: res is overwritten gcpegg-5.1.orig/regtest.c:60:7: style: Variable 'res' is reassigned a value before the old one has been used. [redundantAssignment] gcpegg-5.1.orig/regtest.c:57:7: note: res is assigned gcpegg-5.1.orig/regtest.c:60:7: note: res is overwritten gcpegg-5.1.orig/regtest.c:73:3: style: Statements following noreturn function 'exit()' will never be executed. [unreachableCode] gcpegg-5.1.orig/regtest.c:27:26: style: Parameter 'argv' can be declared as const array [constParameter] gcpegg-5.1.orig/regtest.c:60:7: style: Variable 'res' is assigned a value that is never used. [unreadVariable] gcpegg-5.1.orig/storage.c:140:17: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/storage.c:260:15: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/storage.c:588:15: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/testmain.c:65:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/testmain.c:217:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/egg.c:159:17: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/egg.c:246:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/egg.c:703:17: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/egg.c:904:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/egg.c:958:37: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable sockaddr_in [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/testmain.c:163:7: portability: %ld in format string (no. 3) requires 'long' but the argument type is 'uint32 {aka unsigned long}'. [invalidPrintfArgType_sint] gcpegg-5.1.orig/testmain.c:160:9: style: Variable 'i' is reassigned a value before the old one has been used. [redundantAssignment] gcpegg-5.1.orig/testmain.c:159:9: note: i is assigned gcpegg-5.1.orig/testmain.c:160:9: note: i is overwritten gcpegg-5.1.orig/storage.c:560:8: portability: Non reentrant function 'gmtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'gmtime_r'. [prohibitedgmtimeCalled] gcpegg-5.1.orig/storage.c:482:46: error: Memory leak: rbuf [memleak] gcpegg-5.1.orig/storage.c:284:27: style:inconclusive: Function 'OpenDatabase' argument 1 names different: declaration 'db' definition 'dbp'. [funcArgNamesDifferent] gcpegg-5.1.orig/storage.h:50:34: note: Function 'OpenDatabase' argument 1 names different: declaration 'db' definition 'dbp'. gcpegg-5.1.orig/storage.c:284:27: note: Function 'OpenDatabase' argument 1 names different: declaration 'db' definition 'dbp'. gcpegg-5.1.orig/storage.c:313:28: style:inconclusive: Function 'CloseDatabase' argument 1 names different: declaration 'db' definition 'dbp'. [funcArgNamesDifferent] gcpegg-5.1.orig/storage.h:53:35: note: Function 'CloseDatabase' argument 1 names different: declaration 'db' definition 'dbp'. gcpegg-5.1.orig/storage.c:313:28: note: Function 'CloseDatabase' argument 1 names different: declaration 'db' definition 'dbp'. gcpegg-5.1.orig/storage.c:97:9: style: Variable 'p' can be declared as pointer to const [constVariablePointer] gcpegg-5.1.orig/storage.c:219:48: style: Variable 'sp' can be declared as pointer to const [constVariablePointer] gcpegg-5.1.orig/storage.c:558:14: style: Variable 'tm' can be declared as pointer to const [constVariablePointer] gcpegg-5.1.orig/testudp.c:47:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] gcpegg-5.1.orig/storage.c:231:7: style: Variable 'res' is assigned a value that is never used. [unreadVariable] gcpegg-5.1.orig/testudp.c:41:13: portability: Non reentrant function 'getprotobyname' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getprotobyname_r'. [prohibitedgetprotobynameCalled] gcpegg-5.1.orig/testudp.c:46:13: style: Obsolescent function 'gethostbyname' called. It is recommended to use 'getaddrinfo' instead. [prohibitedgethostbynameCalled] gcpegg-5.1.orig/testudp.c:29:19: style: Variable 'hp' can be declared as pointer to const [constVariablePointer] gcpegg-5.1.orig/basket.c:117:48: portability: Non reentrant function 'gmtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'gmtime_r'. [prohibitedgmtimeCalled] gcpegg-5.1.orig/basket.c:118:50: portability: Non reentrant function 'gmtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'gmtime_r'. [prohibitedgmtimeCalled] gcpegg-5.1.orig/basket.c:149:81: portability: Non reentrant function 'gmtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'gmtime_r'. [prohibitedgmtimeCalled] gcpegg-5.1.orig/basket.c:150:83: portability: Non reentrant function 'gmtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'gmtime_r'. [prohibitedgmtimeCalled] gcpegg-5.1.orig/basket.c:184:19: portability: %ld in format string (no. 1) requires 'long' but the argument type is 'uint32 {aka unsigned long}'. [invalidPrintfArgType_sint] gcpegg-5.1.orig/basket.c:184:19: portability: %ld in format string (no. 2) requires 'long' but the argument type is 'uint32 {aka unsigned long}'. [invalidPrintfArgType_sint] gcpegg-5.1.orig/basket.c:184:19: portability: %ld in format string (no. 3) requires 'long' but the argument type is 'uint32 {aka unsigned long}'. [invalidPrintfArgType_sint] gcpegg-5.1.orig/basket.c:601:44: style:inconclusive: Function 'BasketReceiveDataPacket' argument 1 names different: declaration 'pktbuf' definition 'pkt'. [funcArgNamesDifferent] gcpegg-5.1.orig/basket.c:54:44: note: Function 'BasketReceiveDataPacket' argument 1 names different: declaration 'pktbuf' definition 'pkt'. gcpegg-5.1.orig/basket.c:601:44: note: Function 'BasketReceiveDataPacket' argument 1 names different: declaration 'pktbuf' definition 'pkt'. gcpegg-5.1.orig/basket.c:94:21: style: Variable 'timeFormat' can be declared as const array [constVariable] gcpegg-5.1.orig/basket.c:238:11: style: Variable 'remname' can be declared as pointer to const [constVariablePointer] gcpegg-5.1.orig/basket.c:603:15: style: Variable 'dpktp' can be declared as pointer to const [constVariablePointer] gcpegg-5.1.orig/basket.c:779:43: style: Variable 'name' can be declared as pointer to const [constVariablePointer] gcpegg-5.1.orig/basket.c:489:26: style: Unused variable: i [unusedVariable] gcpegg-5.1.orig/basket.c:642:10: style: Variable 'offset' is assigned a value that is never used. [unreadVariable] gcpegg-5.1.orig/egg.c:382:2: style: Obsolescent function 'usleep' called. It is recommended to use 'nanosleep' or 'setitimer' instead. [prohibitedusleepCalled] gcpegg-5.1.orig/egg.c:183:11: style: Variable 'remname' can be declared as pointer to const [constVariablePointer] gcpegg-5.1.orig/egg.c:695:30: style: Parameter 'filename' can be declared as pointer to const [constParameterPointer] diff: DONE