openvpn/dev-tools/cppcheck-suppression
Frank Lichtenheld 0b7c295350
Some checks are pending
Build / Check code style with clang-format (push) Waiting to run
Build / Android - arm64-v8a (push) Waiting to run
Build / gcc-mingw - x64 - Debug - OSSL (push) Waiting to run
Build / gcc-mingw - x64 - Release - OSSL (push) Waiting to run
Build / gcc-mingw - x86 - Debug - OSSL (push) Waiting to run
Build / gcc-mingw - x86 - Release - OSSL (push) Waiting to run
Build / mingw unittest argv - x64 - Debug - OSSL (push) Blocked by required conditions
Build / mingw unittest auth_token - x64 - Debug - OSSL (push) Blocked by required conditions
Build / mingw unittest buffer - x64 - Debug - OSSL (push) Blocked by required conditions
Build / mingw unittest crypto - x64 - Debug - OSSL (push) Blocked by required conditions
Build / mingw unittest cryptoapi - x64 - Debug - OSSL (push) Blocked by required conditions
Build / mingw unittest misc - x64 - Debug - OSSL (push) Blocked by required conditions
Build / mingw unittest ncp - x64 - Debug - OSSL (push) Blocked by required conditions
Build / mingw unittest openvpnserv - x64 - Debug - OSSL (push) Blocked by required conditions
Build / mingw unittest options_parse - x64 - Debug - OSSL (push) Blocked by required conditions
Build / mingw unittest packet_id - x64 - Debug - OSSL (push) Blocked by required conditions
Build / mingw unittest pkt - x64 - Debug - OSSL (push) Blocked by required conditions
Build / mingw unittest provider - x64 - Debug - OSSL (push) Blocked by required conditions
Build / mingw unittest ssl - x64 - Debug - OSSL (push) Blocked by required conditions
Build / mingw unittest tls_crypt - x64 - Debug - OSSL (push) Blocked by required conditions
Build / mingw unittest user_pass - x64 - Debug - OSSL (push) Blocked by required conditions
Build / mingw unittest argv - x64 - Release - OSSL (push) Blocked by required conditions
Build / mingw unittest auth_token - x64 - Release - OSSL (push) Blocked by required conditions
Build / mingw unittest buffer - x64 - Release - OSSL (push) Blocked by required conditions
Build / mingw unittest crypto - x64 - Release - OSSL (push) Blocked by required conditions
Build / mingw unittest cryptoapi - x64 - Release - OSSL (push) Blocked by required conditions
Build / mingw unittest misc - x64 - Release - OSSL (push) Blocked by required conditions
Build / mingw unittest ncp - x64 - Release - OSSL (push) Blocked by required conditions
Build / mingw unittest openvpnserv - x64 - Release - OSSL (push) Blocked by required conditions
Build / mingw unittest options_parse - x64 - Release - OSSL (push) Blocked by required conditions
Build / mingw unittest packet_id - x64 - Release - OSSL (push) Blocked by required conditions
Build / mingw unittest pkt - x64 - Release - OSSL (push) Blocked by required conditions
Build / mingw unittest provider - x64 - Release - OSSL (push) Blocked by required conditions
Build / mingw unittest ssl - x64 - Release - OSSL (push) Blocked by required conditions
Build / mingw unittest tls_crypt - x64 - Release - OSSL (push) Blocked by required conditions
Build / mingw unittest user_pass - x64 - Release - OSSL (push) Blocked by required conditions
Build / mingw unittest argv - x86 - Debug - OSSL (push) Blocked by required conditions
Build / mingw unittest auth_token - x86 - Debug - OSSL (push) Blocked by required conditions
Build / mingw unittest buffer - x86 - Debug - OSSL (push) Blocked by required conditions
Build / mingw unittest crypto - x86 - Debug - OSSL (push) Blocked by required conditions
Build / mingw unittest cryptoapi - x86 - Debug - OSSL (push) Blocked by required conditions
Build / mingw unittest misc - x86 - Debug - OSSL (push) Blocked by required conditions
Build / mingw unittest ncp - x86 - Debug - OSSL (push) Blocked by required conditions
Build / mingw unittest openvpnserv - x86 - Debug - OSSL (push) Blocked by required conditions
Build / mingw unittest options_parse - x86 - Debug - OSSL (push) Blocked by required conditions
Build / mingw unittest packet_id - x86 - Debug - OSSL (push) Blocked by required conditions
Build / mingw unittest pkt - x86 - Debug - OSSL (push) Blocked by required conditions
Build / mingw unittest provider - x86 - Debug - OSSL (push) Blocked by required conditions
Build / mingw unittest ssl - x86 - Debug - OSSL (push) Blocked by required conditions
Build / mingw unittest tls_crypt - x86 - Debug - OSSL (push) Blocked by required conditions
Build / mingw unittest user_pass - x86 - Debug - OSSL (push) Blocked by required conditions
Build / mingw unittest argv - x86 - Release - OSSL (push) Blocked by required conditions
Build / mingw unittest auth_token - x86 - Release - OSSL (push) Blocked by required conditions
Build / mingw unittest buffer - x86 - Release - OSSL (push) Blocked by required conditions
Build / mingw unittest crypto - x86 - Release - OSSL (push) Blocked by required conditions
Build / mingw unittest cryptoapi - x86 - Release - OSSL (push) Blocked by required conditions
Build / mingw unittest misc - x86 - Release - OSSL (push) Blocked by required conditions
Build / mingw unittest ncp - x86 - Release - OSSL (push) Blocked by required conditions
Build / mingw unittest openvpnserv - x86 - Release - OSSL (push) Blocked by required conditions
Build / mingw unittest options_parse - x86 - Release - OSSL (push) Blocked by required conditions
Build / mingw unittest packet_id - x86 - Release - OSSL (push) Blocked by required conditions
Build / mingw unittest pkt - x86 - Release - OSSL (push) Blocked by required conditions
Build / mingw unittest provider - x86 - Release - OSSL (push) Blocked by required conditions
Build / mingw unittest ssl - x86 - Release - OSSL (push) Blocked by required conditions
Build / mingw unittest tls_crypt - x86 - Release - OSSL (push) Blocked by required conditions
Build / mingw unittest user_pass - x86 - Release - OSSL (push) Blocked by required conditions
Build / gcc - ubuntu-24.04 - OpenSSL 3.0.13 --enable-pkcs11 (push) Waiting to run
Build / gcc - ubuntu-22.04 - OpenSSL 3.0.2 --enable-pkcs11 (push) Waiting to run
Build / clang-asan - ubuntu-22.04 - openssl (push) Waiting to run
Build / clang-asan - ubuntu-24.04 - openssl (push) Waiting to run
Build / macos-14 - libressl - asan (push) Waiting to run
Build / macos-14 - openssl@3 - asan (push) Waiting to run
Build / macos-15 - libressl - asan (push) Waiting to run
Build / macos-15 - openssl@3 - asan (push) Waiting to run
Build / macos-26 - libressl - asan (push) Waiting to run
Build / macos-26 - openssl@3 - asan (push) Waiting to run
Build / macos-14 - libressl - normal (push) Waiting to run
Build / macos-14 - openssl@3 - normal (push) Waiting to run
Build / macos-15 - libressl - normal (push) Waiting to run
Build / macos-15 - openssl@3 - normal (push) Waiting to run
Build / macos-26 - libressl - normal (push) Waiting to run
Build / macos-26 - openssl@3 - normal (push) Waiting to run
Build / msbuild - amd64 - openssl (push) Waiting to run
Build / msbuild - amd64-clang - openssl (push) Waiting to run
Build / msbuild - arm64 - openssl (push) Waiting to run
Build / msbuild - x86 - openssl (push) Waiting to run
Build / msbuild - x86-clang - openssl (push) Waiting to run
Build / libressl (push) Waiting to run
Build / openssl4 (push) Waiting to run
Build / mbedtls4 (push) Waiting to run
Build / aws-lc (push) Waiting to run
Deploy Doxygen documentation to Pages / build (push) Waiting to run
Deploy Doxygen documentation to Pages / deploy (push) Blocked by required conditions
dev-tools: Add script to run cppcheck against the code-base
Also add a suitable suppressions-list file to
make it possible to run it without reporting
errors.

Tested with cppcheck 2.19.0 (Ubuntu 26.04).

Change-Id: I125cf63f11257d7245ead2f7feafb86b841580a5
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1620
Message-Id: <20260419134205.21459-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36664.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2026-04-22 09:44:22 +02:00

87 lines
3.8 KiB
Text

# We start with --enable=all, but then suppress some issues that have too many
# occurences right now. They still should be fixed at some point
constParameter
constParameterCallback
constParameterPointer
constVariable
constVariablePointer
variableScope
# We have a lot of library includes, not all of them are really required,
# so ignore them
missingIncludeSystem
# cppcheck doesn't understand about check_malloc_return, so these are
# usually misleading
nullPointerOutOfMemory
nullPointerArithmeticOutOfMemory
# These are specific false-positives (FP) or ignored (IGN) issues
# We might want to move some of them to inline-suppression to avoid
# the static line-numbers
# IGN: multi code does weird things with pointers to local variables...
autoVariables:src/openvpn/multi.c:4177
autoVariables:src/openvpn/multi_io.c:280
# IGN: the code header = 0 | (OPCODE << P_OPCODE_SHIFT) is used intentionally
badBitmaskCheck:src/openvpn/mudp.c
badBitmaskCheck:tests/unit_tests/openvpn/test_pkt.c
# IGN: event code uses a pointer to store integers
intToPointerCast:src/openvpn/multi_io.c
intToPointerCast:src/openvpn/forward.c
# FP: crt_error is always true on Unix, but not Windows
knownConditionTrueFalse:src/openvpn/error.h:380
# FP: code needs to accomodate many different defines
knownConditionTrueFalse:src/openvpn/event.c:1148
# FP: dco_win support has "false" stubs
knownConditionTrueFalse:src/openvpn/forward.c
knownConditionTrueFalse:src/openvpn/init.c
knownConditionTrueFalse:src/openvpn/multi_io.c:163
# FP: cppcheck thinks that management_query_user_pass is always true,
# but no idea why
knownConditionTrueFalse:src/openvpn/misc.c:97
# FP: cert_uri_supported is a wrapper around defines, so it's
# always constant but differs depending on OpenSSL version
knownConditionTrueFalse:src/openvpn/ssl_openssl.c:1258
# FP: cppcheck doesn't understand that the function changes szErrMessage
knownConditionTrueFalse:src/tapctl/main.c:704
knownConditionTrueFalse:src/openvpnmsica/dllmain.c:164
# FP: cppcheck seems to be confused since we cast the pointer to integer
memleak:src/plugins/down-root/down-root.c:337
# FP: eventmsg.h is not built on Unix
missingInclude:src/openvpnserv/common.c:25
# IGN: strlen(NULL) is not nice code, but seems to work
nullPointerRedundantCheck:src/openvpn/init.c:299
# IGN: We reuse the same variable name due to macro usage
shadowVariable:src/openvpn/options.c:2580
shadowVariable:src/openvpn/options.c:2598
# FP: yes, t_prev is unitialized, but t_prev_len is 0, so that's handled
uninitvar:src/openvpn/crypto_epoch.c:60
# FP: yes, parm is unitialized, but parm_len is 0, so that's handled
uninitvar:src/openvpn/options_parse.c:148
# FP: uninit is fine when it is a return parameter
ctuuninitvar:src/openvpn/crypto_mbedtls_legacy.c:698
uninitvar:src/openvpnserv/interactive.c:1935
uninitvar:src/tapctl/main.c:566
# FP: cppcheck doesn't account for short-circuiting
unreadVariable:src/openvpn/manage.c:682
unusedFunction:src/openvpn/siphash_reference.c
# FP: exported as DLL
unusedFunction:src/openvpnmsica/*.c
# FP: loaded as plugins
unusedFunction:src/plugins/*
unusedFunction:sample/sample-plugins/*
# FP: wmain
unusedFunction:src/tapctl/main.c:613
unusedFunction:tests/unit_tests/openvpnserv/test_openvpnserv.c
# IGN: keep mocking around for future use
unusedFunction:tests/unit_tests/openvpn/mock_msg.c
# FP: doesn't account for --wrap
unusedFunction:tests/unit_tests/openvpn/test_tls_crypt.c
unusedFunction:/usr/include/*
# IGN: old code that is difficult to test (MSG_ERRQUEUE), ignore for now
unusedStructMember:src/openvpn/mtu.c:281
# FP: used implictly by NL macros
unusedStructMember:src/openvpn/networking_sitnl.c
# IGN: keep explanatory fields in test data
unusedStructMember:tests/unit_tests/openvpn/test_pkcs11.c
# IGN: nicer to assign generic "arg" early
variableScope:src/openvpn/networking_sitnl.c:1390
# IGN: nicer to keep the "variable" earlier
variableScope:src/openvpnserv/interactive.c:2687