From: "flichtenheld (Code Review)" Date: Wed, 6 May 2026 21:21:21 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="JdshRjScmS8="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: dev-tools: Fix run-cppcheck to cover more code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --JdshRjScmS8= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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=3Demail 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=3Dexhaustive. Change-Id: I05720ccc3bcf706bbe62254afb74562580f5de56 Signed-off-by: Frank Lichtenheld --- 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 =3D 0 | (OPCODE << P_OPCODE_SHIFT) is used intentio= nally 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/au= th-pam/ \ @@ -21,6 +21,6 @@ --enable=3Dall \ --suppressions-list=3D"${SCRIPT_DIR}/cppcheck-suppression" \ --cppcheck-build-dir=3D"${CPPCHECK_DIR}" \ - --check-level=3Dexhaustive \ + --check-level=3Dexhaustive --force \ --error-exitcode=3D1 \ src/ tests/ sample/ -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1665?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newchange Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I05720ccc3bcf706bbe62254afb74562580f5de56 Gerrit-Change-Number: 1665 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos --JdshRjScmS8= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: plaisthos.

flichtenheld would like plaisthos to review this change.

V= iew Change

dev-tools: Fix run-cppcheck to cover more c=
ode

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=3Dexhaustive.

Change-Id: I05720ccc3bcf7= 06bbe62254afb74562580f5de56
Signed-off-by: Frank Lichtenheld <frank@...220...= ..2641...>
---
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/chan=
ges/65/1665/1
diff --git a/dev-tools/cppcheck-suppression b/dev-too=
ls/cppcheck-suppression
index 1f31edb..1fefb51 100644
--- a/dev-tools/cppcheck-suppression
+++ b/dev-t= ools/cppcheck-suppression
@@ -22,23 +22,28 @@
# IGN: the code header =3D 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 pointe= rs
+CastAddressToInte= gerAtReturn:src/openvpn/multi.c
# IGN: event code uses a p= ointer to store integers
intToPointerCast:src/openvpn/mult= i_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: c= ode 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
+known= ConditionTrueFalse:src/openvpn/fdmisc.c:80
# FP: dco_win s= upport 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 r= eturn true, but they don't
knownConditionTrueFalse:src= /openvpn/misc.c:97
+k= nownConditionTrueFalse:src/openvpn/sig.h:116
# FP: cert_ur= i_supported is a wrapper around defines, so it's
# alw= ays constant but differs depending on OpenSSL version
-knownConditionTrueFalse:src/openvpn/ssl_ope= nssl.c:1258
+knownCon= ditionTrueFalse:src/openvpn/ssl_openssl.c:1332
# FP: cppch= eck doesn't understand that the function changes szErrMessage knownConditionTrueFalse:src/tapctl/main.c:704
know= nConditionTrueFalse:src/openvpnmsica/dllmain.c:164
diff --g= it 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_WIN= 32 \
+ -DHAVE_CONFIG= _H \
-DMBEDTLS_SSL_PROTO_TLS1_3 -DMBEDTLS_SSL_KEY= ING_MATERIAL_EXPORT \
-I./include/ -I./tests/unit_tests/= openvpn/ \
-I./src/compat/ -I./src/openvpn/ -I./src/open= vpnserv/ -I./src/plugins/auth-pam/ \
@@ -21,6 +21,6 @@

--enable=3Dall \
--suppressions-list=3D&q= uot;${SCRIPT_DIR}/cppcheck-suppression" \
--cppchec= k-build-dir=3D"${CPPCHECK_DIR}" \
- --check-level=3Dexhaustive \
+ --check-level=3Dexhaustive --force \

--error-exitcode=3D1 \
src/ tests/ samp= le/

To view, visit change 1665. To unsubscr= ibe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I05720ccc3bcf706bbe62254afb7= 4562580f5de56
Gerrit-Change-Number: 1665
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
= --JdshRjScmS8=--