[S] Change in openvpn[master]: dev-tools: Fix run-cppcheck to cover more code

"flichtenheld (Code Review)" <[email protected]>
Newsgroups gmane.network.openvpn.devel
Message-ID <[email protected]>
Attention is currently required from: plaisthos.

Hello plaisthos,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1665?usp=email

to review the following change.


Change subject: dev-tools: Fix run-cppcheck to cover more code
......................................................................

dev-tools: Fix run-cppcheck to cover more code

When specifying any -D argument all other defines
are ignored unless --force is specified as well.
I mistakenly assumed that this was covered by
--check-level=exhaustive.

Change-Id: I05720ccc3bcf706bbe62254afb74562580f5de56
Signed-off-by: Frank Lichtenheld <[email protected]>
---
M dev-tools/cppcheck-suppression
M dev-tools/run-cppcheck.sh
2 files changed, 10 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/65/1665/1

diff --git a/dev-tools/cppcheck-suppression b/dev-tools/cppcheck-suppression
index 1f31edb..1fefb51 100644
--- a/dev-tools/cppcheck-suppression
+++ b/dev-tools/cppcheck-suppression
@@ -22,23 +22,28 @@
 # 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: we store integers in pointers
+CastAddressToIntegerAtReturn:src/openvpn/multi.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:1139
 knownConditionTrueFalse:src/openvpn/event.c:1148
+# FP: always true on Windows, but not Unix
+knownConditionTrueFalse:src/openvpn/fdmisc.c:80
 # 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
+# FP: cppcheck thinks that some functions always return true, but they don't
 knownConditionTrueFalse:src/openvpn/misc.c:97
+knownConditionTrueFalse:src/openvpn/sig.h:116
 # 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
+knownConditionTrueFalse:src/openvpn/ssl_openssl.c:1332
 # FP: cppcheck doesn't understand that the function changes szErrMessage
 knownConditionTrueFalse:src/tapctl/main.c:704
 knownConditionTrueFalse:src/openvpnmsica/dllmain.c:164
diff --git a/dev-tools/run-cppcheck.sh b/dev-tools/run-cppcheck.sh
index 674fc092..8fe9c97 100755
--- a/dev-tools/run-cppcheck.sh
+++ b/dev-tools/run-cppcheck.sh
@@ -13,7 +13,7 @@
 mkdir -p "$CPPCHECK_DIR"
 cd "${SOURCE_DIR}"
 cppcheck -j$(nproc) \
-	 -DHAVE_CONFIG_H -U_WIN32 \
+	 -DHAVE_CONFIG_H \
          -DMBEDTLS_SSL_PROTO_TLS1_3 -DMBEDTLS_SSL_KEYING_MATERIAL_EXPORT \
 	 -I./include/ -I./tests/unit_tests/openvpn/ \
 	 -I./src/compat/ -I./src/openvpn/ -I./src/openvpnserv/ -I./src/plugins/auth-pam/ \
@@ -21,6 +21,6 @@
 	 --enable=all \
 	 --suppressions-list="${SCRIPT_DIR}/cppcheck-suppression" \
 	 --cppcheck-build-dir="${CPPCHECK_DIR}" \
-	 --check-level=exhaustive \
+	 --check-level=exhaustive --force \
 	 --error-exitcode=1 \
 	 src/ tests/ sample/

-- 
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1665?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I05720ccc3bcf706bbe62254afb74562580f5de56
Gerrit-Change-Number: 1665
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]>
Gerrit-Reviewer: plaisthos <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.