2022-06-20 18:20 ftp://ftp.de.debian.org/debian/pool/main/a/apg/apg_2.2.3.dfsg.1.orig.tar.gz cppcheck-options: --library=posix --library=gnu --showtime=top5 --check-library --inconclusive --enable=style,information --template=daca2 -D__GNUC__ --platform=unix64 -rp=temp -j1 platform: Linux-5.4.0-120-generic-x86_64-with-glibc2.29 python: 3.8.10 client-version: 1.3.24 compiler: g++ (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0 cppcheck: head 2.8 head-info: 5b9fa96 (2022-06-20 20:02:22 +0200) count: 61 61 elapsed-time: 15.1 14.6 head-timing-info: Tokenizer::simplifyTokens1: 4.79553s (avg. 0.368887s - 13 result(s)) Tokenizer::simplifyTokens1::ValueFlow: 4.49157s (avg. 0.345506s - 13 result(s)) Tokenizer::simplifyTokens1::createSymbolDatabase: 0.225243s (avg. 0.0173264s - 13 result(s)) Tokenizer::createTokens: 0.036214s (avg. 0.00278569s - 13 result(s)) Tokenizer::simplifyTokens1::setValueType: 0.019541s (avg. 0.00150315s - 13 result(s)) Overall time: 9.66757s old-timing-info: Tokenizer::simplifyTokens1: 4.64758s (avg. 0.357506s - 13 result(s)) Tokenizer::simplifyTokens1::ValueFlow: 4.29307s (avg. 0.330236s - 13 result(s)) Tokenizer::simplifyTokens1::createSymbolDatabase: 0.268966s (avg. 0.0206897s - 13 result(s)) Tokenizer::createTokens: 0.035959s (avg. 0.00276608s - 13 result(s)) Tokenizer::simplifyTokens1::setValueType: 0.018918s (avg. 0.00145523s - 13 result(s)) Overall time: 9.36523s head results: apg-2.2.3.dfsg.1/apg.c:574:2: portability: %d in format string (no. 1) requires 'int' but the argument type is 'size_t {aka unsigned long}'. [invalidPrintfArgType_sint] apg-2.2.3.dfsg.1/apg.c:705:26: style:inconclusive: Function 'construct_mode' argument 1 names different: declaration 'str_mode' definition 's_mode'. [funcArgNamesDifferent] apg-2.2.3.dfsg.1/apg.c:103:26: note: Function 'construct_mode' argument 1 names different: declaration 'str_mode' definition 's_mode'. apg-2.2.3.dfsg.1/apg.c:705:26: note: Function 'construct_mode' argument 1 names different: declaration 'str_mode' definition 's_mode'. apg-2.2.3.dfsg.1/apg.c:709:9: style: Variable 'ch' is assigned a value that is never used. [unreadVariable] apg-2.2.3.dfsg.1/apgbfm.c:184:24: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] apg-2.2.3.dfsg.1/apgbfm.c:244:24: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] apg-2.2.3.dfsg.1/apgbfm.c:292:24: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] apg-2.2.3.dfsg.1/bfconvert/bfconvert.c:102:4: error: Resource leak: old_f [resourceLeak] apg-2.2.3.dfsg.1/bfconvert/bfconvert.c:108:7: error: Resource leak: old_f [resourceLeak] apg-2.2.3.dfsg.1/bfconvert/bfconvert.c:108:7: error: Resource leak: new_f [resourceLeak] apg-2.2.3.dfsg.1/bfconvert/bfconvert.c:119:7: error: Resource leak: old_f [resourceLeak] apg-2.2.3.dfsg.1/bfconvert/bfconvert.c:119:7: error: Resource leak: new_f [resourceLeak] apg-2.2.3.dfsg.1/bfconvert/bfconvert.c:138:7: error: Resource leak: old_f [resourceLeak] apg-2.2.3.dfsg.1/bfconvert/bfconvert.c:138:7: error: Resource leak: new_f [resourceLeak] apg-2.2.3.dfsg.1/bfconvert/bfconvert.c:76:7: style: Variable 'old_etalon_bf_id' can be declared as const array [constVariable] apg-2.2.3.dfsg.1/bfconvert/bfconvert.c:78:7: style: Variable 'new_etalon_bf_id' can be declared as const array [constVariable] apg-2.2.3.dfsg.1/bfconvert/bfconvert.c:79:7: style: Variable 'new_etalon_bf_ver' can be declared as const array [constVariable] apg-2.2.3.dfsg.1/bloom.c:382:18: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] apg-2.2.3.dfsg.1/bloom.c:223:8: error: Resource leak: f [resourceLeak] apg-2.2.3.dfsg.1/bloom.c:227:9: error: Resource leak: f [resourceLeak] apg-2.2.3.dfsg.1/bloom.c:231:9: error: Resource leak: f [resourceLeak] apg-2.2.3.dfsg.1/bloom.c:235:7: error: Resource leak: f [resourceLeak] apg-2.2.3.dfsg.1/bloom.c:352:8: error: Resource leak: f [resourceLeak] apg-2.2.3.dfsg.1/bloom.c:215:7: style: Variable 'etalon_bf_id' can be declared as const array [constVariable] apg-2.2.3.dfsg.1/bloom.c:216:7: style: Variable 'etalon_bf_ver' can be declared as const array [constVariable] apg-2.2.3.dfsg.1/bloom.c:329:7: style: Variable 'etalon_bf_id' can be declared as const array [constVariable] apg-2.2.3.dfsg.1/bloom.c:330:7: style: Variable 'etalon_bf_ver' can be declared as const array [constVariable] apg-2.2.3.dfsg.1/cast/cast.c:76:4: style: Variable 't' is assigned a value that is never used. [unreadVariable] apg-2.2.3.dfsg.1/cast/cast.c:76:8: style: Variable 'l' is assigned a value that is never used. [unreadVariable] apg-2.2.3.dfsg.1/cast/cast.c:76:12: style: Variable 'r' is assigned a value that is never used. [unreadVariable] apg-2.2.3.dfsg.1/cast/cast.c:121:4: style: Variable 't' is assigned a value that is never used. [unreadVariable] apg-2.2.3.dfsg.1/cast/cast.c:121:8: style: Variable 'l' is assigned a value that is never used. [unreadVariable] apg-2.2.3.dfsg.1/cast/cast.c:121:12: style: Variable 'r' is assigned a value that is never used. [unreadVariable] apg-2.2.3.dfsg.1/cast/cast.c:234:8: style: Variable 't[i]' is assigned a value that is never used. [unreadVariable] apg-2.2.3.dfsg.1/cast/cast.c:234:15: style: Variable 'x[i]' is assigned a value that is never used. [unreadVariable] apg-2.2.3.dfsg.1/cast/cast.c:234:22: style: Variable 'z[i]' is assigned a value that is never used. [unreadVariable] apg-2.2.3.dfsg.1/convert.c:78:8: style: Variable 'i' is assigned a value that is never used. [unreadVariable] apg-2.2.3.dfsg.1/convert.c:104:8: style: Variable 'i' is assigned a value that is never used. [unreadVariable] apg-2.2.3.dfsg.1/convert.c:230:8: style: Variable 'i' is assigned a value that is never used. [unreadVariable] apg-2.2.3.dfsg.1/convert.c:366:9: style: Variable 'j' is assigned a value that is never used. [unreadVariable] apg-2.2.3.dfsg.1/pronpass.c:1506:24: style: Parameter 'units' can be declared as pointer to const [constParameter] apg-2.2.3.dfsg.1/pronpass.c:1568:25: style: Parameter 'units' can be declared as pointer to const [constParameter] apg-2.2.3.dfsg.1/pronpass.c:1606:27: style: Parameter 'units' can be declared as pointer to const [constParameter] apg-2.2.3.dfsg.1/pronpass.c:2094:28: style: Parameter 'units' can be declared as pointer to const [constParameter] apg-2.2.3.dfsg.1/pronpass.c:1324:13: style: Variable 'dsd' is assigned a value that is never used. [unreadVariable] apg-2.2.3.dfsg.1/pronpass.c:1669:26: style: Variable 'current_unit' is assigned a value that is never used. [unreadVariable] apg-2.2.3.dfsg.1/pronpass.c:1670:25: style: Variable 'vowel_count' is assigned a value that is never used. [unreadVariable] apg-2.2.3.dfsg.1/pronpass.c:1674:19: style: Variable 'tries' is assigned a value that is never used. [unreadVariable] apg-2.2.3.dfsg.1/pronpass.c:1676:25: style: Variable 'length_left' is assigned a value that is never used. [unreadVariable] apg-2.2.3.dfsg.1/randpass.c:62:9: style: Variable 'j' is assigned a value that is never used. [unreadVariable] apg-2.2.3.dfsg.1/randpass.c:139:14: style: Variable 'max_weight' is assigned a value that is never used. [unreadVariable] apg-2.2.3.dfsg.1/randpass.c:140:29: style: Variable 'max_weight_element_number' is assigned a value that is never used. [unreadVariable] apg-2.2.3.dfsg.1/restrict.c:72:10: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] apg-2.2.3.dfsg.1/restrict.c:68:4: error: Memory leak: string [memleak] apg-2.2.3.dfsg.1/restrict.c:145:17: style: Variable 'substr_len' is assigned a value that is never used. [unreadVariable] apg-2.2.3.dfsg.1/restrict.c:146:8: style: Variable 'k' is assigned a value that is never used. [unreadVariable] apg-2.2.3.dfsg.1/restrict.c:147:8: style: Variable 'c' is assigned a value that is never used. [unreadVariable] apg-2.2.3.dfsg.1/restrict.c:148:10: style: Variable 'ret' is assigned a value that is never used. [unreadVariable] apg-2.2.3.dfsg.1/restrict.c:233:4: style: Variable 'i' is assigned a value that is never used. [unreadVariable] apg-2.2.3.dfsg.1/bloom.c:251:16: warning: Null pointer dereference: f_dsk [ctunullpointer] apg-2.2.3.dfsg.1/apgbfm.c:269:59: note: Assuming that condition '(f_filter=create_filter(filter,wc,flt_mode))==NULL' is not redundant apg-2.2.3.dfsg.1/apgbfm.c:271:18: note: Calling function close_filter, 1st argument is null apg-2.2.3.dfsg.1/bloom.c:251:16: note: Dereferencing argument f_dsk that is null apg-2.2.3.dfsg.1/bloom.c:266:13: warning: Null pointer dereference: f [ctunullpointer] apg-2.2.3.dfsg.1/apgbfm.c:161:50: note: Assuming that condition '(f_filter=open_filter(filter,"r+"))==NULL' is not redundant apg-2.2.3.dfsg.1/apgbfm.c:163:34: note: Calling function get_filtersize, 1st argument is null apg-2.2.3.dfsg.1/bloom.c:266:13: note: Dereferencing argument f that is null apg-2.2.3.dfsg.1/bloom.c:288:13: warning: Null pointer dereference: f [ctunullpointer] apg-2.2.3.dfsg.1/apgbfm.c:161:50: note: Assuming that condition '(f_filter=open_filter(filter,"r+"))==NULL' is not redundant apg-2.2.3.dfsg.1/apgbfm.c:164:34: note: Calling function get_filtermode, 1st argument is null apg-2.2.3.dfsg.1/bloom.c:288:13: note: Dereferencing argument f that is null diff: head apg-2.2.3.dfsg.1/bfconvert/bfconvert.c:76:7: style: Variable 'old_etalon_bf_id' can be declared as const array [constVariable] 2.8 apg-2.2.3.dfsg.1/bfconvert/bfconvert.c:76:7: style: Variable 'old_etalon_bf_id' can be declared with const [constVariable] head apg-2.2.3.dfsg.1/bfconvert/bfconvert.c:78:7: style: Variable 'new_etalon_bf_id' can be declared as const array [constVariable] 2.8 apg-2.2.3.dfsg.1/bfconvert/bfconvert.c:78:7: style: Variable 'new_etalon_bf_id' can be declared with const [constVariable] head apg-2.2.3.dfsg.1/bfconvert/bfconvert.c:79:7: style: Variable 'new_etalon_bf_ver' can be declared as const array [constVariable] 2.8 apg-2.2.3.dfsg.1/bfconvert/bfconvert.c:79:7: style: Variable 'new_etalon_bf_ver' can be declared with const [constVariable] head apg-2.2.3.dfsg.1/bloom.c:215:7: style: Variable 'etalon_bf_id' can be declared as const array [constVariable] 2.8 apg-2.2.3.dfsg.1/bloom.c:215:7: style: Variable 'etalon_bf_id' can be declared with const [constVariable] head apg-2.2.3.dfsg.1/bloom.c:216:7: style: Variable 'etalon_bf_ver' can be declared as const array [constVariable] 2.8 apg-2.2.3.dfsg.1/bloom.c:216:7: style: Variable 'etalon_bf_ver' can be declared with const [constVariable] head apg-2.2.3.dfsg.1/bloom.c:329:7: style: Variable 'etalon_bf_id' can be declared as const array [constVariable] 2.8 apg-2.2.3.dfsg.1/bloom.c:329:7: style: Variable 'etalon_bf_id' can be declared with const [constVariable] head apg-2.2.3.dfsg.1/bloom.c:330:7: style: Variable 'etalon_bf_ver' can be declared as const array [constVariable] 2.8 apg-2.2.3.dfsg.1/bloom.c:330:7: style: Variable 'etalon_bf_ver' can be declared with const [constVariable] head apg-2.2.3.dfsg.1/pronpass.c:1506:24: style: Parameter 'units' can be declared as pointer to const [constParameter] 2.8 apg-2.2.3.dfsg.1/pronpass.c:1506:24: style: Parameter 'units' can be declared with const [constParameter] head apg-2.2.3.dfsg.1/pronpass.c:1568:25: style: Parameter 'units' can be declared as pointer to const [constParameter] 2.8 apg-2.2.3.dfsg.1/pronpass.c:1568:25: style: Parameter 'units' can be declared with const [constParameter] head apg-2.2.3.dfsg.1/pronpass.c:1606:27: style: Parameter 'units' can be declared as pointer to const [constParameter] 2.8 apg-2.2.3.dfsg.1/pronpass.c:1606:27: style: Parameter 'units' can be declared with const [constParameter] head apg-2.2.3.dfsg.1/pronpass.c:2094:28: style: Parameter 'units' can be declared as pointer to const [constParameter] 2.8 apg-2.2.3.dfsg.1/pronpass.c:2094:28: style: Parameter 'units' can be declared with const [constParameter] DONE