From: "flichtenheld (Code Review)" Date: Thu, 12 Mar 2026 13:25:17 +0000 In-Reply-To: References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, gert@...1296... Message-ID: <73709d3647100198c271350976fd203cd0100863-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="JWOAiFyqcug="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: error: Use SOCKET_UNDEFINED instead of -1 to avoid sign error on Windows List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --JWOAiFyqcug= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, plaisthos. Hello cron2, plaisthos, I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/1501?usp=3Demail to look at the new patch set (#8). The change is no longer submittable: checks~ChecksSubmitRule is unsatisfied= now. Change subject: error: Use SOCKET_UNDEFINED instead of -1 to avoid sign err= or on Windows ...................................................................... error: Use SOCKET_UNDEFINED instead of -1 to avoid sign error on Windows While here also mark a comparison we know is safe with an explicit cast. Change-Id: I96b6acffd7e5149d4c9488a06e43c62711b31cfc Signed-off-by: Frank Lichtenheld --- M src/openvpn/error.c 1 file changed, 13 insertions(+), 24 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/01/1501/8 diff --git a/src/openvpn/error.c b/src/openvpn/error.c index 6fb4f32..2900352 100644 --- a/src/openvpn/error.c +++ b/src/openvpn/error.c @@ -97,15 +97,10 @@ forked =3D true; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-compare" -#endif - bool set_debug_level(const int level, const unsigned int flags) { - if (level >=3D 0 && level <=3D M_DEBUG_LEVEL) + if (level >=3D 0 && (unsigned int)level <=3D M_DEBUG_LEVEL) { x_debug_level =3D (msglvl_t)level; return true; @@ -118,10 +113,6 @@ return false; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - bool set_mute_cutoff(const int cutoff) { @@ -621,11 +612,6 @@ x_cs_verbose_level =3D verbose_level; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-compare" -#endif - /* * Called after most socket or tun/tap operations, via the inline * function check_status(). @@ -674,15 +660,22 @@ { if (extended_msg) { - msg(x_cs_info_level, "%s %s [%s]: %s (fd=3D" SOCKET_PRINTF= ",code=3D%d)", description, - sock ? proto2ascii(sock->info.proto, sock->info.af, tr= ue) : "", extended_msg, - openvpn_strerror(my_errno, crt_error, &gc), sock ? soc= k->sd : -1, my_errno); + msg(x_cs_info_level, "%s %s [%s]: %s (fd=3D" SOCKET_PRINTF= ",code=3D%d)", + description, + sock ? proto2ascii(sock->info.proto, sock->info.af, tr= ue) : "", + extended_msg, + openvpn_strerror(my_errno, crt_error, &gc), + sock ? sock->sd : SOCKET_UNDEFINED, + my_errno); } else { - msg(x_cs_info_level, "%s %s: %s (fd=3D" SOCKET_PRINTF ",co= de=3D%d)", description, + msg(x_cs_info_level, "%s %s: %s (fd=3D" SOCKET_PRINTF ",co= de=3D%d)", + description, sock ? proto2ascii(sock->info.proto, sock->info.af, tr= ue) : "", - openvpn_strerror(my_errno, crt_error, &gc), sock ? soc= k->sd : -1, my_errno); + openvpn_strerror(my_errno, crt_error, &gc), + sock ? sock->sd : SOCKET_UNDEFINED, + my_errno); } if (x_cs_err_delay_ms) @@ -694,10 +687,6 @@ } } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - /* * In multiclient mode, put a client-specific prefix * before each message. -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1501?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newpatchset Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I96b6acffd7e5149d4c9488a06e43c62711b31cfc Gerrit-Change-Number: 1501 Gerrit-PatchSet: 8 Gerrit-Owner: flichtenheld Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld --JWOAiFyqcug= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: flichtenheld, plaisthos.

flichtenheld uploaded patch set #8 to this change.

<= p>View C= hange

The change is no longer submittable: checks~ChecksSubmitRul= e is unsatisfied now.

error: Use SOCKET_UNDEFINED instead =
of -1 to avoid sign error on Windows

While here also mark a comparis= on we know is safe
with an explicit cast.

Change-Id: I96b6acffd7e= 5149d4c9488a06e43c62711b31cfc
Signed-off-by: Frank Lichtenheld <frank= @...2641...>
---
M src/openvpn/error.c
1 file changed, 13 inser= tions(+), 24 deletions(-)

git pull ssh://gerrit.=
openvpn.net:29418/openvpn refs/changes/01/1501/8
diff --git a/src/o=
penvpn/error.c b/src/openvpn/error.c
index 6fb4f32..2900352= 100644
--- a/src/openvpn/error.c
+++ b/src= /openvpn/error.c
@@ -97,15 +97,10 @@
f= orked =3D true;
}

-#if defined(__GNUC__) || defined(__clang__)=
-#pragma GCC diagnosti= c push
-#pragma GCC dia= gnostic ignored "-Wsign-compare"
-#endif
-
bool
set_debug_level(const int lev= el, const unsigned int flags)
{
- if (level >=3D 0 && level <=3D= M_DEBUG_LEVEL)
+ = if (level >=3D 0 && (unsigned int)level <=3D M_DEBUG_LEVEL)
{
x_debug_level =3D (msglvl_t)= level;
return true;
@@ -118,10 +11= 3,6 @@
return false;
}

-#if defined(__GNUC= __) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-
bool
set_mute_cutoff(const int cutoff)<= br> {
@@ -621,11 +612,6 @@
x_cs_= verbose_level =3D verbose_level;
}

-#if defined(__GNUC__) || de= fined(__clang__)
-#prag= ma GCC diagnostic push
= -#pragma GCC diagnostic ignored "-Wsign-compare"
-#endif
-
/*
* Called after= most socket or tun/tap operations, via the inline
* func= tion check_status().
@@ -674,15 +660,22 @@
= {
if (extended_msg)
= {
- = msg(x_cs_info_level, "%s %s [%s]: %s (fd=3D" SOCKET_PRINT= F ",code=3D%d)", description,
- sock ? proto2ascii(sock->info.prot= o, sock->info.af, true) : "", extended_msg,
- openvpn_strerror(my_= errno, crt_error, &gc), sock ? sock->sd : -1, my_errno);
<= span style=3D"color: hsl(120, 100%, 40%);">+ msg(x_cs_info_l= evel, "%s %s [%s]: %s (fd=3D" SOCKET_PRINTF ",code=3D%d)&quo= t;,

+ = description,
+ = sock ? proto2ascii(sock->info.proto, sock->info.af, = true) : "",
+ extended_msg,
+ openvpn_strerror(my_errno, crt_error, &= amp;gc),
+ = sock ? sock->sd : SOCKET_UNDEFINED,
+ my_errno);
= }
else
= {
- m= sg(x_cs_info_level, "%s %s: %s (fd=3D" SOCKET_PRINTF ",code= =3D%d)", description,
+ msg(x_cs_info_level, "%s %s: %s (fd=3D" SO= CKET_PRINTF ",code=3D%d)",
+ description,
= sock ? proto2ascii(sock->info.proto, sock->info.af, true)= : "",
- = openvpn_strerror(my_errno, crt_error, &gc), sock ? sock-= >sd : -1, my_errno);
+ openvpn_strerror(my_errno, crt_error, &gc),
+ soc= k ? sock->sd : SOCKET_UNDEFINED,
+ my_errno);
= }

if (x_cs_err_delay_ms)
@@ -694,10 +687,6 @@
}
= }

-#i= f defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-
/*
* In multiclient mode, put= a client-specific prefix
* before each message.

To view, visit change 1501. To unsubscribe, or for = help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I96b6acffd7e5149d4c9488a06e4= 3c62711b31cfc
Gerrit-Change-Number: 1501
Gerrit-PatchSet: 8
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
= --JWOAiFyqcug=--