From: "cron2 (Code Review)" Date: Thu, 12 Mar 2026 14:28:54 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <04803c650a1ce13a96eab4ae2fc8c69d76d09710-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="SLjA3nn0FSM="; 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: flichtenheld , plaisthos Cc: openvpn-devel --SLjA3nn0FSM= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#9) to the change originally created by= flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1501?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by cron2 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 Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1501 Message-Id: <20260312074123.30838-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36= 046.html Signed-off-by: Gert Doering --- M src/openvpn/error.c 1 file changed, 13 insertions(+), 24 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/01/1501/9 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: 9 Gerrit-Owner: flichtenheld Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --SLjA3nn0FSM= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 upl= oaded patch set #9 to the change originally created by flichtenhel= d.

View Change

The following approvals got outdated and were remove= d: Code-Review+2 by cron2

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

While here also mark a compari= son we know is safe
with an explicit cast.

Change-Id: I96b6acffd7= e5149d4c9488a06e43c62711b31cfc
Signed-off-by: Frank Lichtenheld <fran= k@...2641...>
Acked-by: Gert Doering <gert@...1296...>
Gerri= t URL: https://gerrit.openvpn.net/c/openvpn/+/1501
Message-Id: <20260= 312074123.30838-1-gert@...1296...>
URL: https://www.mail-archive.com/= openvpn-devel@lists.sourceforge.net/msg36046.html
Signed-off-by: Gert Do= ering <gert@...1296...>
---
M src/openvpn/error.c
1 file cha= nged, 13 insertions(+), 24 deletions(-)

git pull=
 ssh://gerrit.openvpn.net:29418/openvpn refs/changes/01/1501/9
diff=
 --git a/src/openvpn/error.c b/src/openvpn/error.c
index 6f= b4f32..2900352 100644
--- a/src/openvpn/error.c
<= span>+++ b/src/openvpn/error.c
@@ -97,15 +97,10 @@ forked =3D true;
}
-#if defined(__GNUC__) || defin= ed(__clang__)
-#pragma = GCC diagnostic push
-#p= ragma 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_D= EBUG_LEVEL)
{
x_debug_level = =3D (msglvl_t)level;
return true;
= @@ -118,10 +113,6 @@
return false;
}<= /span>

-#if = defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-
bool
set_mute_cutoff(const int c= utoff)
{
@@ -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, true) : "", extended_msg,
- openvp= n_strerror(my_errno, crt_error, &gc), sock ? sock->sd : -1, my_errno= );
+ m= sg(x_cs_info_level, "%s %s [%s]: %s (fd=3D" SOCKET_PRINTF ",= code=3D%d)",
+ = description,
+ sock ? proto2ascii(sock->info.proto, sock= ->info.af, true) : "",
+ extended_msg,
+ openvpn_strerror(my_errno= , crt_error, &gc),
+ my_errno);
}
else
{

- = msg(x_cs_info_level, "%s %s: %s (fd=3D" SOCKET_PRINT= F ",code=3D%d)", description,
+ msg(x_cs_info_level, "%s %s: %s (f= d=3D" SOCKET_PRINTF ",code=3D%d)",
+ description,
sock ? proto2ascii(sock->info.proto, sock->i= nfo.af, true) : "",

- openvpn_strerror(my_errno, crt_error, &gc),= sock ? sock->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 multicli= ent mode, put a client-specific prefix
* before each mess= age.

To view, visit change 1501. To unsubsc= ribe, 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: 9
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>
= --SLjA3nn0FSM=--