2024-04-23 20:14 ftp://ftp.de.debian.org/debian/pool/main/b/bpfmon/bpfmon_2.52.orig.tar.xz cppcheck-options: --library=posix --library=gnu --check-library --inconclusive --enable=style,information --inline-suppr --disable=missingInclude --suppress=unmatchedSuppression --template=daca2 --debug-warnings --suppress=autoNoType --suppress=valueFlowBailout --suppress=bailoutUninitVar --suppress=symbolDatabaseWarning -D__GNUC__ --platform=unix64 -j2 platform: Linux-6.6.15-amd64-x86_64-with-glibc2.37 python: 3.11.8 client-version: 1.3.53 compiler: g++ (Debian 13.2.0-13) 13.2.0 cppcheck: head 2.14.0 head-info: 24be0e5 (2024-04-23 14:04:36 +0200) count: 50 50 elapsed-time: 2.2 2.2 head-timing-info: old-timing-info: head results: bpfmon-2.52/psort.c:176:16: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable CLOCK_MONOTONIC [valueFlowBailoutIncompleteVar] bpfmon-2.52/psort.c:198:34: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable YAS_INVERSE [valueFlowBailoutIncompleteVar] bpfmon-2.52/psort.c:387:18: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable PRIu64 [valueFlowBailoutIncompleteVar] bpfmon-2.52/psort.c:440:42: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable YAS_INVERSE [valueFlowBailoutIncompleteVar] bpfmon-2.52/psort.c:552:10: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable DLT_LINUX_SLL [valueFlowBailoutIncompleteVar] bpfmon-2.52/psort.c:631:12: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable PCAP_ERRBUF_SIZE [valueFlowBailoutIncompleteVar] bpfmon-2.52/bpfmon.c:169:16: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable CLOCK_MONOTONIC [valueFlowBailoutIncompleteVar] bpfmon-2.52/bpfmon.c:190:18: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable PRIu64 [valueFlowBailoutIncompleteVar] bpfmon-2.52/bpfmon.c:233:22: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable YAS_NOBUFF [valueFlowBailoutIncompleteVar] bpfmon-2.52/bpfmon.c:256:34: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable YAS_INVERSE [valueFlowBailoutIncompleteVar] bpfmon-2.52/bpfmon.c:423:12: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable YAS_INVERSE [valueFlowBailoutIncompleteVar] bpfmon-2.52/bpfmon.c:486:14: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] bpfmon-2.52/bpfmon.c:573:22: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SCNu64 [valueFlowBailoutIncompleteVar] bpfmon-2.52/bpfmon.c:587:12: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable PCAP_ERRBUF_SIZE [valueFlowBailoutIncompleteVar] bpfmon-2.52/bpfmon.c:255:11: style: Condition '-1!=(wl=mbstowcs(ws,cap,strlen(cap)))' is always true [knownConditionTrueFalse] bpfmon-2.52/bpfmon.c:916:70: style: Same expression in both branches of ternary operator. [duplicateExpressionTernary] bpfmon-2.52/bpfmon.c:564:7: style: Local variable 's' shadows outer variable [shadowVariable] bpfmon-2.52/bpfmon.c:114:18: note: Shadowed declaration bpfmon-2.52/bpfmon.c:564:7: note: Shadow variable bpfmon-2.52/bpfmon.c:565:11: style: Local variable 'pc' shadows outer variable [shadowVariable] bpfmon-2.52/bpfmon.c:157:21: note: Shadowed declaration bpfmon-2.52/bpfmon.c:565:11: note: Shadow variable bpfmon-2.52/bpfmon.c:901:12: style: Local variable 'i' shadows outer variable [shadowVariable] bpfmon-2.52/bpfmon.c:600:6: note: Shadowed declaration bpfmon-2.52/bpfmon.c:901:12: note: Shadow variable bpfmon-2.52/bpfmon.c:1065:13: style: Local variable 'now' shadows outer variable [shadowVariable] bpfmon-2.52/bpfmon.c:858:11: note: Shadowed declaration bpfmon-2.52/bpfmon.c:1065:13: note: Shadow variable bpfmon-2.52/bpfmon.c:240:31: style: Parameter 'cap' can be declared as pointer to const [constParameterPointer] bpfmon-2.52/bpfmon.c:441: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.52/bpfmon.c:1226:28: note: You might need to cast the function pointer here bpfmon-2.52/bpfmon.c:441:34: note: Parameter 'user' can be declared as pointer to const bpfmon-2.52/bpfmon.c:730:17: style: Variable 'a3' can be declared as pointer to const [constVariablePointer] bpfmon-2.52/bpfmon.c:258:17: error: Uninitialized variable: wl [legacyUninitvar] bpfmon-2.52/bpfmon.c:54:8: style: struct member '_s_grf::bf' is never used. [unusedStructMember] bpfmon-2.52/bpfmon.c:61:9: style: struct member '_s_bpf::bf' is never used. [unusedStructMember] bpfmon-2.52/bpfmon.c:62:8: style: struct member '_s_bpf::bfh' is never used. [unusedStructMember] bpfmon-2.52/psort.c:197:11: style: Condition '-1!=(wl=mbstowcs(ws,cap,strlen(cap)))' is always true [knownConditionTrueFalse] bpfmon-2.52/psort.c:257:2: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] bpfmon-2.52/psort.c:257:2: warning: %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] bpfmon-2.52/psort.c:257:2: warning: %d in format string (no. 3) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] bpfmon-2.52/psort.c:257:2: warning: %d in format string (no. 4) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] bpfmon-2.52/psort.c:255:14: style: Local variable 's' shadows outer variable [shadowVariable] bpfmon-2.52/psort.c:107:18: note: Shadowed declaration bpfmon-2.52/psort.c:255:14: note: Shadow variable bpfmon-2.52/psort.c:553:10: style: Local variable 's' shadows outer variable [shadowVariable] bpfmon-2.52/psort.c:107:18: note: Shadowed declaration bpfmon-2.52/psort.c:553:10: note: Shadow variable bpfmon-2.52/psort.c:849:13: style: Local variable 'now' shadows outer variable [shadowVariable] bpfmon-2.52/psort.c:764:11: note: Shadowed declaration bpfmon-2.52/psort.c:849:13: note: Shadow variable bpfmon-2.52/psort.c:182:31: style: Parameter 'cap' can be declared as pointer to const [constParameterPointer] bpfmon-2.52/psort.c:393:62: style: Parameter 'i1' can be declared as pointer to const [constParameterPointer] bpfmon-2.52/psort.c:393:71: style: Parameter 'i2' can be declared as pointer to const [constParameterPointer] bpfmon-2.52/psort.c:393:80: style: Parameter 'i3' can be declared as pointer to const [constParameterPointer] bpfmon-2.52/psort.c:393:89: style: Parameter 'i4' can be declared as pointer to const [constParameterPointer] bpfmon-2.52/psort.c:553:10: style: Variable 's' can be declared as pointer to const [constVariablePointer] bpfmon-2.52/psort.c:572:11: style: Variable 'e' can be declared as pointer to const [constVariablePointer] bpfmon-2.52/psort.c:574:13: style: Variable 't' can be declared as pointer to const [constVariablePointer] bpfmon-2.52/psort.c:200:17: error: Uninitialized variable: wl [legacyUninitvar] bpfmon-2.52/psort.c:88:10: style: struct member 's_ip_hdr::tos' is never used. [unusedStructMember] bpfmon-2.52/psort.c:89:11: style: struct member 's_ip_hdr::hl' is never used. [unusedStructMember] bpfmon-2.52/psort.c:90:11: style: struct member 's_ip_hdr::id' is never used. [unusedStructMember] bpfmon-2.52/psort.c:91:11: style: struct member 's_ip_hdr::off' is never used. [unusedStructMember] bpfmon-2.52/psort.c:92:10: style: struct member 's_ip_hdr::ttl' is never used. [unusedStructMember] bpfmon-2.52/psort.c:94:11: style: struct member 's_ip_hdr::cks' is never used. [unusedStructMember] diff: DONE