2024-03-28 00:28 ftp://ftp.de.debian.org/debian/pool/main/libi/libifp/libifp_1.0.0.2.orig.tar.gz 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: 98951f5 (2024-03-27 21:50:05 +0100) count: 97 92 elapsed-time: 1.9 3.3 head-timing-info: Tokenizer::simplifyTokens1::ValueFlow: 1.8606s (avg. 1.8606s - 1 result(s)) valueFlowCondition(SimpleConditionHandler{}, tokenlist, symboldatabase, errorLogger, settings, skippedFunctions): 1.13271s (avg. 0.283176s - 4 result(s)) valueFlowAfterAssign(tokenlist, symboldatabase, errorLogger, settings, skippedFunctions): 0.630883s (avg. 0.157721s - 4 result(s)) valueFlowUninit(tokenlist, errorLogger, settings): 0.037975s (avg. 0.00949375s - 4 result(s)) valueFlowLifetime(tokenlist, errorLogger, settings): 0.024786s (avg. 0.0049572s - 5 result(s)) Overall time: 1.9127s old-timing-info: Tokenizer::simplifyTokens1::ValueFlow: 3.21883s (avg. 3.21883s - 1 result(s)) valueFlowAfterAssign(tokenlist, symboldatabase, errorLogger, settings, skippedFunctions): 1.6876s (avg. 0.421901s - 4 result(s)) valueFlowCondition(SimpleConditionHandler{}, tokenlist, symboldatabase, errorLogger, settings, skippedFunctions): 1.05061s (avg. 0.262653s - 4 result(s)) valueFlowLifetime(tokenlist, errorLogger, settings): 0.346194s (avg. 0.0692388s - 5 result(s)) valueFlowSymbolic(tokenlist, symboldatabase, settings): 0.067127s (avg. 0.067127s - 1 result(s)) Overall time: 3.26707s head results: libifp-1.0.0.2/examples/simple.c:36:28: style: Parameter 'context' can be declared as pointer to const. However it seems that 'simple_dump_dir' is a callback function, if 'context' is declared with const you might also need to cast function pointer(s). [constParameterCallback] libifp-1.0.0.2/examples/simple.c:53:31: note: You might need to cast the function pointer here libifp-1.0.0.2/examples/simple.c:36:28: note: Parameter 'context' can be declared as pointer to const libifp-1.0.0.2/src/ifp_os_libusb.c:273:16: style: Expression is always true because 'else if' condition is opposite to previous condition at line 269. [multiCondition] libifp-1.0.0.2/src/ifp_os_libusb.c:269:6: note: first condition libifp-1.0.0.2/src/ifp_os_libusb.c:273:16: note: else if condition is opposite to first condition libifp-1.0.0.2/src/ifp_os_libusb.c:84:23: style: The comparison 'i == 0' is always true. [knownConditionTrueFalse] libifp-1.0.0.2/src/ifp_os_libusb.c:83:8: note: 'i' is assigned value '0' here. libifp-1.0.0.2/src/ifp_os_libusb.c:84:23: note: The comparison 'i == 0' is always true. libifp-1.0.0.2/src/ifp_os_libusb.c:78:1: style: Label 'err' is not used. [unusedLabel] libifp-1.0.0.2/src/ifp_os_libusb.c:103:1: style: Label 'err' is not used. [unusedLabel] libifp-1.0.0.2/src/ifp_os_libusb.c:71:32: style:inconclusive: Function 'ifp_locale_to_utf16' argument 1 names different: declaration 'o' definition 'ob'. [funcArgNamesDifferent] libifp-1.0.0.2/src/ifp_os.h:135:32: note: Function 'ifp_locale_to_utf16' argument 1 names different: declaration 'o' definition 'ob'. libifp-1.0.0.2/src/ifp_os_libusb.c:71:32: note: Function 'ifp_locale_to_utf16' argument 1 names different: declaration 'o' definition 'ob'. libifp-1.0.0.2/src/ifp_os_libusb.c:71:60: style:inconclusive: Function 'ifp_locale_to_utf16' argument 3 names different: declaration 'i' definition 'ib'. [funcArgNamesDifferent] libifp-1.0.0.2/src/ifp_os.h:135:59: note: Function 'ifp_locale_to_utf16' argument 3 names different: declaration 'i' definition 'ib'. libifp-1.0.0.2/src/ifp_os_libusb.c:71:60: note: Function 'ifp_locale_to_utf16' argument 3 names different: declaration 'i' definition 'ib'. libifp-1.0.0.2/src/ifp_os_libusb.c:92:32: style:inconclusive: Function 'ifp_utf16_to_locale' argument 1 names different: declaration 'o' definition 'ob'. [funcArgNamesDifferent] libifp-1.0.0.2/src/ifp_os.h:136:32: note: Function 'ifp_utf16_to_locale' argument 1 names different: declaration 'o' definition 'ob'. libifp-1.0.0.2/src/ifp_os_libusb.c:92:32: note: Function 'ifp_utf16_to_locale' argument 1 names different: declaration 'o' definition 'ob'. libifp-1.0.0.2/src/ifp_os_libusb.c:92:60: style:inconclusive: Function 'ifp_utf16_to_locale' argument 3 names different: declaration 'i' definition 'ib'. [funcArgNamesDifferent] libifp-1.0.0.2/src/ifp_os.h:136:59: note: Function 'ifp_utf16_to_locale' argument 3 names different: declaration 'i' definition 'ib'. libifp-1.0.0.2/src/ifp_os_libusb.c:92:60: note: Function 'ifp_utf16_to_locale' argument 3 names different: declaration 'i' definition 'ib'. libifp-1.0.0.2/src/ifp_os_libusb.c:208:49: style:inconclusive: Function 'ifp_os_init' argument 2 names different: declaration 'osdev' definition 'device_handle'. [funcArgNamesDifferent] libifp-1.0.0.2/src/ifp_os.h:36:49: note: Function 'ifp_os_init' argument 2 names different: declaration 'osdev' definition 'device_handle'. libifp-1.0.0.2/src/ifp_os_libusb.c:208:49: note: Function 'ifp_os_init' argument 2 names different: declaration 'osdev' definition 'device_handle'. libifp-1.0.0.2/src/ifp_os_libusb.c:82:36: style: Parameter 'data' can be declared as pointer to const [constParameterPointer] libifp-1.0.0.2/src/comp.c:252:2: style: The if condition is the same as the previous if condition [duplicateCondition] libifp-1.0.0.2/src/comp.c:248:14: note: First condition libifp-1.0.0.2/src/comp.c:252:2: note: Second condition libifp-1.0.0.2/src/comp.c:292:3: warning: Either the condition 'offset==NULL' is redundant or there is possible null pointer dereference: offset. [nullPointerRedundantCheck] libifp-1.0.0.2/src/comp.c:288:2: note: Assuming that condition 'offset==NULL' is not redundant libifp-1.0.0.2/src/comp.c:292:3: note: Null pointer dereference libifp-1.0.0.2/src/comp.c:56:7: style: Variable 'i' is reassigned a value before the old one has been used. [redundantAssignment] libifp-1.0.0.2/src/comp.c:42:11: note: i is assigned libifp-1.0.0.2/src/comp.c:56:7: note: i is overwritten libifp-1.0.0.2/src/comp.c:56:7: style: Variable 'i' is reassigned a value before the old one has been used. [redundantAssignment] libifp-1.0.0.2/src/comp.c:49:11: note: i is assigned libifp-1.0.0.2/src/comp.c:56:7: note: i is overwritten libifp-1.0.0.2/src/ifp_os_linux.c:310:0: error: #error "makefile error" [preprocessorErrorDirective] libifp-1.0.0.2/src/comp.c:136:1: style: Label 'out' is not used. [unusedLabel] libifp-1.0.0.2/src/comp.c:264:1: style: Label 'out' is not used. [unusedLabel] libifp-1.0.0.2/src/comp.c:362:1: style: Label 'out' is not used. [unusedLabel] libifp-1.0.0.2/src/comp.c:390:1: style: Label 'out' is not used. [unusedLabel] libifp-1.0.0.2/src/comp.c:412:1: style: Label 'out' is not used. [unusedLabel] libifp-1.0.0.2/src/comp.c:434:1: style: Label 'out' is not used. [unusedLabel] libifp-1.0.0.2/src/comp.c:469:1: style: Label 'out' is not used. [unusedLabel] libifp-1.0.0.2/src/comp.c:603:1: style: Label 'out' is not used. [unusedLabel] libifp-1.0.0.2/src/comp.c:705:1: style: Label 'out' is not used. [unusedLabel] libifp-1.0.0.2/src/comp.c:785:1: style: Label 'err' is not used. [unusedLabel] libifp-1.0.0.2/src/comp.c:812:1: style: Label 'err' is not used. [unusedLabel] libifp-1.0.0.2/src/comp.c:27:12: style: Variable 'battery_info' can be declared as pointer to const [constVariablePointer] libifp-1.0.0.2/src/comp.c:197:9: style: Variable 'target' can be declared as pointer to const [constVariablePointer] libifp-1.0.0.2/src/comp.c:198:8: style: Variable 'target_width' can be declared as pointer to const [constVariablePointer] libifp-1.0.0.2/src/main.c:21:1: error: There is an unknown macro here somewhere. Configuration is required. If module_init is a macro then please configure it. [unknownMacro] libifp-1.0.0.2/src/prim.c:1402:0: error: #error "assumptions no longer true." [preprocessorErrorDirective] libifp-1.0.0.2/src/tuner.c:21:12: style: Variable 'bm' can be declared as pointer to const [constVariablePointer] libifp-1.0.0.2/examples/selftest.c:1114:7: style: Condition 'e' is always false [knownConditionTrueFalse] libifp-1.0.0.2/examples/selftest.c:1104:15: note: Assignment 'e=0', assigned value is 0 libifp-1.0.0.2/examples/selftest.c:1114:7: note: Condition 'e' is always false libifp-1.0.0.2/examples/selftest.c:205:1: style: Label 'err1' is not used. [unusedLabel] libifp-1.0.0.2/examples/selftest.c:366:1: style: Label 'err' is not used. [unusedLabel] libifp-1.0.0.2/examples/selftest.c:457:1: style: Label 'err' is not used. [unusedLabel] libifp-1.0.0.2/examples/selftest.c:682:1: style: Label 'err' is not used. [unusedLabel] libifp-1.0.0.2/examples/selftest.c:1091:1: style: Label 'err' is not used. [unusedLabel] libifp-1.0.0.2/examples/selftest.c:219:11: style: Variable 'r' can be declared as pointer to const [constVariablePointer] libifp-1.0.0.2/examples/selftest.c:254:34: style: Parameter 'context' can be declared as pointer to const. However it seems that '_noop_callback' is a callback function, if 'context' is declared with const you might also need to cast function pointer(s). [constParameterCallback] libifp-1.0.0.2/examples/selftest.c:267:58: note: You might need to cast the function pointer here libifp-1.0.0.2/examples/selftest.c:254:34: note: Parameter 'context' can be declared as pointer to const libifp-1.0.0.2/examples/selftest.c:990:68: style: Parameter 'p' can be declared as pointer to const. However it seems that 'progress_bar_dual' is a callback function, if 'p' is declared with const you might also need to cast function pointer(s). [constParameterCallback] libifp-1.0.0.2/examples/selftest.c:1077:91: note: You might need to cast the function pointer here libifp-1.0.0.2/examples/selftest.c:990:68: note: Parameter 'p' can be declared as pointer to const libifp-1.0.0.2/examples/selftest.c:1035:64: style: Parameter 'p' can be declared as pointer to const [constParameterPointer] libifp-1.0.0.2/src/readwrite.c:276:2: style: The if condition is the same as the previous if condition [duplicateCondition] libifp-1.0.0.2/src/readwrite.c:273:36: note: First condition libifp-1.0.0.2/src/readwrite.c:276:2: note: Second condition libifp-1.0.0.2/src/readwrite.c:512:6: style: Condition 'e' is always false [knownConditionTrueFalse] libifp-1.0.0.2/src/readwrite.c:505:10: note: Assignment 'e=0', assigned value is 0 libifp-1.0.0.2/src/readwrite.c:512:6: note: Condition 'e' is always false libifp-1.0.0.2/src/readwrite.c:132:1: style: Label 'out2' is not used. [unusedLabel] libifp-1.0.0.2/src/readwrite.c:135:1: style: Label 'out1' is not used. [unusedLabel] libifp-1.0.0.2/src/readwrite.c:175:1: style: Label 'out' is not used. [unusedLabel] libifp-1.0.0.2/src/readwrite.c:389:1: style: Label 'out' is not used. [unusedLabel] libifp-1.0.0.2/src/readwrite.c:459:1: style: Label 'out2' is not used. [unusedLabel] libifp-1.0.0.2/src/readwrite.c:462:1: style: Label 'out1' is not used. [unusedLabel] libifp-1.0.0.2/src/readwrite.c:591:1: style: Label 'out' is not used. [unusedLabel] libifp-1.0.0.2/src/readwrite.c:15:9: style: Variable 'c' can be declared as pointer to const [constVariablePointer] libifp-1.0.0.2/src/readwrite.c:36:50: style: Parameter 'dev' can be declared as pointer to const [constParameterPointer] libifp-1.0.0.2/src/readwrite.c:285:38: style: Parameter 'dev' can be declared as pointer to const [constParameterPointer] libifp-1.0.0.2/src/readwrite.c:291:39: style: Parameter 'dev' can be declared as pointer to const [constParameterPointer] libifp-1.0.0.2/src/readwrite.c:235:8: style: Variable 'i' is assigned a value that is never used. [unreadVariable] libifp-1.0.0.2/src/userfile.c:734:8: warning: Assignment of function parameter has no effect outside the function. Did you forget dereferencing it? [uselessAssignmentPtrArg] libifp-1.0.0.2/src/userfile.c:1216:16: error: Buffer is accessed out of bounds: buf [bufferAccessOutOfBounds] libifp-1.0.0.2/src/userfile.c:512:6: style: Condition 'i' is always false [knownConditionTrueFalse] libifp-1.0.0.2/src/userfile.c:511:15: note: Calling function 'll_insert' returns 0 libifp-1.0.0.2/src/userfile.c:511:15: note: Assignment 'i=ll_insert(p,n,d)', assigned value is 0 libifp-1.0.0.2/src/userfile.c:512:6: note: Condition 'i' is always false libifp-1.0.0.2/src/userfile.c:130:1: style: Label 'out0' is not used. [unusedLabel] libifp-1.0.0.2/src/userfile.c:180:1: style: Label 'out0' is not used. [unusedLabel] libifp-1.0.0.2/src/userfile.c:256:1: style: Label 'err' is not used. [unusedLabel] libifp-1.0.0.2/src/userfile.c:296:1: style: Label 'err' is not used. [unusedLabel] libifp-1.0.0.2/src/userfile.c:396:1: style: Label 'err' is not used. [unusedLabel] libifp-1.0.0.2/src/userfile.c:428:1: style: Label 'err' is not used. [unusedLabel] libifp-1.0.0.2/src/userfile.c:461:1: style: Label 'err' is not used. [unusedLabel] libifp-1.0.0.2/src/userfile.c:773:1: style: Label 'err_1' is not used. [unusedLabel] libifp-1.0.0.2/src/userfile.c:780:1: style: Label 'err_0' is not used. [unusedLabel] libifp-1.0.0.2/src/userfile.c:819:1: style: Label 'err_0' is not used. [unusedLabel] libifp-1.0.0.2/src/userfile.c:940:1: style: Label 'err_1' is not used. [unusedLabel] libifp-1.0.0.2/src/userfile.c:946:1: style: Label 'err_0' is not used. [unusedLabel] libifp-1.0.0.2/src/userfile.c:1045:1: style: Label 'err_1' is not used. [unusedLabel] libifp-1.0.0.2/src/userfile.c:1097:1: style: Label 'err' is not used. [unusedLabel] libifp-1.0.0.2/src/userfile.c:1140:1: style: Label 'err' is not used. [unusedLabel] libifp-1.0.0.2/src/userfile.c:1242:1: style: Label 'err0' is not used. [unusedLabel] libifp-1.0.0.2/src/userfile.c:792:30: style: Variable 'r' can be declared as pointer to const [constVariablePointer] libifp-1.0.0.2/examples/ifpline.c:583:33: style: Checking if unsigned expression 'len=strlen(target)' is less than zero. [unsignedLessThanZero] libifp-1.0.0.2/examples/ifpline.c:231:1: style: Label 'err' is not used. [unusedLabel] libifp-1.0.0.2/examples/ifpline.c:275:1: style: Label 'err' is not used. [unusedLabel] libifp-1.0.0.2/examples/ifpline.c:329:1: style: Label 'err1' is not used. [unusedLabel] libifp-1.0.0.2/examples/ifpline.c:334:1: style: Label 'err0' is not used. [unusedLabel] libifp-1.0.0.2/examples/ifpline.c:361:1: style: Label 'err' is not used. [unusedLabel] libifp-1.0.0.2/examples/ifpline.c:412:1: style: Label 'err' is not used. [unusedLabel] libifp-1.0.0.2/examples/ifpline.c:497:1: style: Label 'err' is not used. [unusedLabel] libifp-1.0.0.2/examples/ifpline.c:543:1: style: Label 'err' is not used. [unusedLabel] libifp-1.0.0.2/examples/ifpline.c:893:1: style: Label 'out_0' is not used. [unusedLabel] libifp-1.0.0.2/examples/ifpline.c:38:73: style: Parameter 'status' can be declared as pointer to const. However it seems that 'update_progress' is a callback function, if 'status' is declared with const you might also need to cast function pointer(s). [constParameterCallback] libifp-1.0.0.2/examples/ifpline.c:384:40: note: You might need to cast the function pointer here libifp-1.0.0.2/examples/ifpline.c:38:73: note: Parameter 'status' can be declared as pointer to const libifp-1.0.0.2/examples/ifpline.c:39:9: style: Variable 'verb' can be declared as pointer to const [constVariablePointer] libifp-1.0.0.2/examples/ifpline.c:134:9: style: Variable 'verb' can be declared as pointer to const [constVariablePointer] libifp-1.0.0.2/examples/ifpline.c:300:30: style: Variable 'f' can be declared as pointer to const [constVariablePointer] libifp-1.0.0.2/examples/ifpline.c:461:18: style: Parameter 'argv' can be declared as const array [constParameter] libifp-1.0.0.2/examples/ifpline.c:501:55: style: Parameter 'argv' can be declared as const array [constParameter] libifp-1.0.0.2/examples/ifpline.c:741:12: style: Variable 'cmd' can be declared as pointer to const [constVariablePointer] libifp-1.0.0.2/examples/ifpline.c:742:12: style: Variable 'mc_arg' can be declared as pointer to const [constVariablePointer] libifp-1.0.0.2/examples/ifpline.c:899:17: style: Parameter 'prog' can be declared as pointer to const [constParameterPointer] libifp-1.0.0.2/examples/ifpline.c:748:9: style: Variable 'mc_arg' is assigned a value that is never used. [unreadVariable] diff: head libifp-1.0.0.2/examples/ifpline.c:501:55: style: Parameter 'argv' can be declared as const array [constParameter] head libifp-1.0.0.2/examples/selftest.c:1035:64: style: Parameter 'p' can be declared as pointer to const [constParameterPointer] head libifp-1.0.0.2/examples/selftest.c:254:34: style: Parameter 'context' can be declared as pointer to const. However it seems that '_noop_callback' is a callback function, if 'context' is declared with const you might also need to cast function pointer(s). [constParameterCallback] libifp-1.0.0.2/examples/selftest.c:267:58: note: You might need to cast the function pointer here libifp-1.0.0.2/examples/selftest.c:254:34: note: Parameter 'context' can be declared as pointer to const head libifp-1.0.0.2/examples/selftest.c:990:68: style: Parameter 'p' can be declared as pointer to const. However it seems that 'progress_bar_dual' is a callback function, if 'p' is declared with const you might also need to cast function pointer(s). [constParameterCallback] libifp-1.0.0.2/examples/selftest.c:1077:91: note: You might need to cast the function pointer here libifp-1.0.0.2/examples/selftest.c:990:68: note: Parameter 'p' can be declared as pointer to const head libifp-1.0.0.2/examples/simple.c:36:28: style: Parameter 'context' can be declared as pointer to const. However it seems that 'simple_dump_dir' is a callback function, if 'context' is declared with const you might also need to cast function pointer(s). [constParameterCallback] libifp-1.0.0.2/examples/simple.c:53:31: note: You might need to cast the function pointer here libifp-1.0.0.2/examples/simple.c:36:28: note: Parameter 'context' can be declared as pointer to const DONE