From: "flichtenheld (Code Review)" Date: Fri, 30 Jan 2026 16:11:15 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: <51339f3c253d5ec336468c8db101eec1228b6d13-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="WsMugBdgRSg="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: wfp_block: Avoid sign-compare warning with Fwpm* return types List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --WsMugBdgRSg= 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/+/1506?usp=3Demail to review the following change. Change subject: wfp_block: Avoid sign-compare warning with Fwpm* return typ= es ...................................................................... wfp_block: Avoid sign-compare warning with Fwpm* return types FWP_E_ALREADY_EXISTS is explictly casted to HRESULT which is LONG. But Fwpm* return DWORD. So if you compare an expected result with the actual result you get an sign-compare warning... Change-Id: I2f6502da1832edcb273a0dfa9b3ef940bec2d711 Signed-off-by: Frank Lichtenheld --- M src/openvpn/wfp_block.c 1 file changed, 1 insertion(+), 10 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/06/1506/1 diff --git a/src/openvpn/wfp_block.c b/src/openvpn/wfp_block.c index 74d19ce..4d38fdb 100644 --- a/src/openvpn/wfp_block.c +++ b/src/openvpn/wfp_block.c @@ -131,11 +131,6 @@ return err; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-compare" -#endif - /* * Block outgoing local traffic, possibly DNS only, except for * (i) adapter with the specified index (and loopback, if all is blocked) @@ -198,7 +193,7 @@ * do not treat "already exists" as an error */ err =3D add_sublayer(OPENVPN_WFP_BLOCK_SUBLAYER); - if (err =3D=3D FWP_E_ALREADY_EXISTS || err =3D=3D ERROR_SUCCESS) + if (err =3D=3D (DWORD)FWP_E_ALREADY_EXISTS || err =3D=3D ERROR_SUC= CESS) { msg_handler(0, "WFP Block: Added a persistent sublayer with pr= e-defined UUID"); } @@ -345,10 +340,6 @@ return err; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - DWORD delete_wfp_block_filters(HANDLE engine_handle) { -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1506?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: I2f6502da1832edcb273a0dfa9b3ef940bec2d711 Gerrit-Change-Number: 1506 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos --WsMugBdgRSg= 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

wfp_block: Avoid sign-compare warning with =
Fwpm* return types

FWP_E_ALREADY_EXISTS is explictly casted to HRESU= LT which
is LONG. But Fwpm* return DWORD. So if you compare an expected<= br>result with the actual result you get an sign-compare warning...

= Change-Id: I2f6502da1832edcb273a0dfa9b3ef940bec2d711
Signed-off-by: Fran= k Lichtenheld <frank@...2641...>
---
M src/openvpn/wfp_block.c<= br>1 file changed, 1 insertion(+), 10 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/06/1506/1<=
/pre>
-#if de=
fined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-compare&q= uot;
-#endif
= -
/*
<= span> * Block outgoing local traffic, possibly DNS only, except for=
* (i) adapter with the specified index (and loopback, if all is= blocked)
@@ -198,7 +193,7 @@
* do = not treat "already exists" as an error */
= err =3D add_sublayer(OPENVPN_WFP_BLOCK_SUBLAYER);

- if (err =3D=3D FWP_= E_ALREADY_EXISTS || err =3D=3D ERROR_SUCCESS)
+ if (err =3D=3D (DWORD)FWP_E_ALREADY_EXIST= S || err =3D=3D ERROR_SUCCESS)
{
= msg_handler(0, "WFP Block: Added a persistent sublayer wit= h pre-defined UUID");
}
@@ -3= 45,10 +340,6 @@
return err;
}<= br>
-#if defined= (__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
= -
DWORD
delete_wfp_block_filters(HANDLE e= ngine_handle)
{

To vie= w, visit change 1506. To unsubscribe, or for help writing mail filters, visit <= a href=3D"http://gerrit.openvpn.net/settings?usp=3Demail">settings.

=
<= meta itemprop=3D"name" content=3D"View Change"/>
Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I2f6502da1832edcb273a0dfa9b3= ef940bec2d711
Gerrit-Change-Number: 1506
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...>
= --WsMugBdgRSg=--