From: "flichtenheld (Code Review)" Date: Wed, 8 Oct 2025 16:53:52 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: <7b3a5e16442fbc9b7de2059ab1ad9ecf951c46cb-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="FmDRQ6cwZk4="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: options_util: Fix conversion warning in atoi_constrained List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --FmDRQ6cwZk4= 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/+/1261?usp=3Demail to review the following change. Change subject: options_util: Fix conversion warning in atoi_constrained ...................................................................... options_util: Fix conversion warning in atoi_constrained The whole purpose of the function is to make sure that cast is safe. Change-Id: Id08524661aa5bcc5cd42f27a1aacc636e2b2b004 Signed-off-by: Frank Lichtenheld --- M src/openvpn/options_util.c 1 file changed, 1 insertion(+), 10 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/61/1261/1 diff --git a/src/openvpn/options_util.c b/src/openvpn/options_util.c index 8a1c083..eba7d39 100644 --- a/src/openvpn/options_util.c +++ b/src/openvpn/options_util.c @@ -162,11 +162,6 @@ return (int)i; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - bool atoi_constrained(const char *str, int *value, const char *name, int min, i= nt max, msglvl_t msglevel) { @@ -194,14 +189,10 @@ return false; } - *value =3D i; + *value =3D (int)i; return true; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - static const char *updatable_options[] =3D { "block-ipv6", "block-outside-= dns", "dhcp-option", "dns", "ifconfig", "ifconfig-ipv6", -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1261?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: Id08524661aa5bcc5cd42f27a1aacc636e2b2b004 Gerrit-Change-Number: 1261 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos --FmDRQ6cwZk4= 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

options_util: Fix conversion warning in ato=
i_constrained

The whole purpose of the function is to make sure
t= hat cast is safe.

Change-Id: Id08524661aa5bcc5cd42f27a1aacc636e2b2b0= 04
Signed-off-by: Frank Lichtenheld <frank@...2641...>
---
M= src/openvpn/options_util.c
1 file changed, 1 insertion(+), 10 deletions= (-)

git pull ssh://gerrit.openvpn.net:29418/open=
vpn refs/changes/61/1261/1
diff --git a/src/openvpn/options_util.c =
b/src/openvpn/options_util.c
index 8a1c083..eba7d39 100644<= /span>
--- a/src/openvpn/options_util.c
+++ b/src/= openvpn/options_util.c
@@ -162,11 +162,6 @@
return (int)i;

}

-#if defined(__GNUC__) || defined(__clan= g__)
-#pragma GCC diagn= ostic push
-#pragma GCC= diagnostic ignored "-Wconversion"
-#endif
-
bool
atoi_constrained(const char= *str, int *value, const char *name, int min, int max, msglvl_t msglevel)
{
@@ -194,14 +189,10 @@
= return false;
}

- *value =3D i;

+ *value =3D (int)i;
return true;
}

-#if defined(__GNUC__) || defined(__clang_= _)
-#pragma GCC diagnos= tic pop
-#endif<= br>-
static cons= t char *updatable_options[] =3D { "block-ipv6", "block-outsi= de-dns",
&= quot;dhcp-option", "dns",
= "ifconfig", "ifconfig-ipv6",<= /span>

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

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Id08524661aa5bcc5cd42f27a1aa= cc636e2b2b004
Gerrit-Change-Number: 1261
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...>
= --FmDRQ6cwZk4=--