2025-05-09 13:27 ftp://ftp.de.debian.org/debian/pool/main/b/bpfmon/bpfmon_2.53.orig.tar.xz 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 -j3 platform: Linux-6.8.0-1022-oracle-aarch64-with-glibc2.39 python: 3.12.3 client-version: 1.3.67 compiler: g++ (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 cppcheck: head 2.17.0 head-info: d655a3a (2025-05-09 12:19:47 +0200) count: 51 51 elapsed-time: 2.2 2.2 head-timing-info: old-timing-info: head results: bpfmon-2.53/psort.c:176:16: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable CLOCK_MONOTONIC [valueFlowBailoutIncompleteVar] bpfmon-2.53/bpfmon.c:176:16: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable CLOCK_MONOTONIC [valueFlowBailoutIncompleteVar] bpfmon-2.53/psort.c:198:34: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable YAS_INVERSE [valueFlowBailoutIncompleteVar] bpfmon-2.53/bpfmon.c:197:18: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable PRIu64 [valueFlowBailoutIncompleteVar] bpfmon-2.53/psort.c:387:18: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable PRIu64 [valueFlowBailoutIncompleteVar] bpfmon-2.53/bpfmon.c:240:22: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable YAS_NOBUFF [valueFlowBailoutIncompleteVar] bpfmon-2.53/psort.c:440:42: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable YAS_INVERSE [valueFlowBailoutIncompleteVar] bpfmon-2.53/bpfmon.c:263:34: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable YAS_INVERSE [valueFlowBailoutIncompleteVar] bpfmon-2.53/psort.c:552:10: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable DLT_LINUX_SLL [valueFlowBailoutIncompleteVar] bpfmon-2.53/bpfmon.c:430:12: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable YAS_INVERSE [valueFlowBailoutIncompleteVar] bpfmon-2.53/psort.c:631:12: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable PCAP_ERRBUF_SIZE [valueFlowBailoutIncompleteVar] bpfmon-2.53/bpfmon.c:493:14: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] bpfmon-2.53/bpfmon.c:580:22: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SCNu64 [valueFlowBailoutIncompleteVar] bpfmon-2.53/bpfmon.c:594:12: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable PCAP_ERRBUF_SIZE [valueFlowBailoutIncompleteVar] bpfmon-2.53/bpfmon.c:262:11: style: Condition '-1!=(wl=mbstowcs(ws,cap,strlen(cap)))' is always true [knownConditionTrueFalse] bpfmon-2.53/bpfmon.c:926:70: style: Same expression in both branches of ternary operator. [duplicateExpressionTernary] bpfmon-2.53/bpfmon.c:571:7: style: Local variable 's' shadows outer variable [shadowVariable] bpfmon-2.53/bpfmon.c:120:18: note: Shadowed declaration bpfmon-2.53/bpfmon.c:571:7: note: Shadow variable bpfmon-2.53/bpfmon.c:572:11: style: Local variable 'pc' shadows outer variable [shadowVariable] bpfmon-2.53/bpfmon.c:164:21: note: Shadowed declaration bpfmon-2.53/bpfmon.c:572:11: note: Shadow variable bpfmon-2.53/bpfmon.c:911:12: style: Local variable 'i' shadows outer variable [shadowVariable] bpfmon-2.53/bpfmon.c:607:6: note: Shadowed declaration bpfmon-2.53/bpfmon.c:911:12: note: Shadow variable bpfmon-2.53/bpfmon.c:1083:13: style: Local variable 'now' shadows outer variable [shadowVariable] bpfmon-2.53/bpfmon.c:868:11: note: Shadowed declaration bpfmon-2.53/bpfmon.c:1083:13: note: Shadow variable bpfmon-2.53/bpfmon.c:247:31: style: Parameter 'cap' can be declared as pointer to const [constParameterPointer] bpfmon-2.53/bpfmon.c:448:34: style: Parameter 'user' can be declared as pointer to const. However it seems that 'pc_cb' is a callback function, if 'user' is declared with const you might also need to cast function pointer(s). [constParameterCallback] bpfmon-2.53/bpfmon.c:1248:28: note: You might need to cast the function pointer here bpfmon-2.53/bpfmon.c:448:34: note: Parameter 'user' can be declared as pointer to const bpfmon-2.53/bpfmon.c:739:17: style: Variable 'a3' can be declared as pointer to const [constVariablePointer] bpfmon-2.53/bpfmon.c:265:17: error: Uninitialized variable: wl [legacyUninitvar] bpfmon-2.53/bpfmon.c:60:8: style: struct member '_s_grf::bf' is never used. [unusedStructMember] bpfmon-2.53/bpfmon.c:67:9: style: struct member '_s_bpf::bf' is never used. [unusedStructMember] bpfmon-2.53/bpfmon.c:68:8: style: struct member '_s_bpf::bfh' is never used. [unusedStructMember] bpfmon-2.53/psort.c:197:11: style: Condition '-1!=(wl=mbstowcs(ws,cap,strlen(cap)))' is always true [knownConditionTrueFalse] bpfmon-2.53/psort.c:257:2: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] bpfmon-2.53/psort.c:257:2: warning: %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] bpfmon-2.53/psort.c:257:2: warning: %d in format string (no. 3) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] bpfmon-2.53/psort.c:257:2: warning: %d in format string (no. 4) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] bpfmon-2.53/psort.c:255:14: style: Local variable 's' shadows outer variable [shadowVariable] bpfmon-2.53/psort.c:107:18: note: Shadowed declaration bpfmon-2.53/psort.c:255:14: note: Shadow variable bpfmon-2.53/psort.c:553:10: style: Local variable 's' shadows outer variable [shadowVariable] bpfmon-2.53/psort.c:107:18: note: Shadowed declaration bpfmon-2.53/psort.c:553:10: note: Shadow variable bpfmon-2.53/psort.c:849:13: style: Local variable 'now' shadows outer variable [shadowVariable] bpfmon-2.53/psort.c:764:11: note: Shadowed declaration bpfmon-2.53/psort.c:849:13: note: Shadow variable bpfmon-2.53/psort.c:182:31: style: Parameter 'cap' can be declared as pointer to const [constParameterPointer] bpfmon-2.53/psort.c:393:62: style: Parameter 'i1' can be declared as pointer to const [constParameterPointer] bpfmon-2.53/psort.c:393:71: style: Parameter 'i2' can be declared as pointer to const [constParameterPointer] bpfmon-2.53/psort.c:393:80: style: Parameter 'i3' can be declared as pointer to const [constParameterPointer] bpfmon-2.53/psort.c:393:89: style: Parameter 'i4' can be declared as pointer to const [constParameterPointer] bpfmon-2.53/psort.c:553:10: style: Variable 's' can be declared as pointer to const [constVariablePointer] bpfmon-2.53/psort.c:572:11: style: Variable 'e' can be declared as pointer to const [constVariablePointer] bpfmon-2.53/psort.c:574:13: style: Variable 't' can be declared as pointer to const [constVariablePointer] bpfmon-2.53/psort.c:637:8: style: Variable 'p' can be declared as pointer to const [constVariablePointer] bpfmon-2.53/psort.c:200:17: error: Uninitialized variable: wl [legacyUninitvar] bpfmon-2.53/psort.c:88:10: style: struct member 's_ip_hdr::tos' is never used. [unusedStructMember] bpfmon-2.53/psort.c:89:11: style: struct member 's_ip_hdr::hl' is never used. [unusedStructMember] bpfmon-2.53/psort.c:90:11: style: struct member 's_ip_hdr::id' is never used. [unusedStructMember] bpfmon-2.53/psort.c:91:11: style: struct member 's_ip_hdr::off' is never used. [unusedStructMember] bpfmon-2.53/psort.c:92:10: style: struct member 's_ip_hdr::ttl' is never used. [unusedStructMember] bpfmon-2.53/psort.c:94:11: style: struct member 's_ip_hdr::cks' is never used. [unusedStructMember] diff: DONE