From: "cron2 (Code Review)" Date: Thu, 9 Oct 2025 14:53:15 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <5080f068cd8698f364b7c67ceb89e24dc04c7bd7-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="B1788fh5hqY="; 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: flichtenheld Cc: plaisthos , openvpn-devel --B1788fh5hqY= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/12= 61?usp=3Demail ) 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 Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1261 Message-Id: <20251008170202.10333-1-gert@...1296...> URL: https://sourceforge.net/p/openvpn/mailman/message/59244107/ Signed-off-by: Gert Doering --- M src/openvpn/options_util.c 1 file changed, 1 insertion(+), 10 deletions(-) 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: merged Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Id08524661aa5bcc5cd42f27a1aacc636e2b2b004 Gerrit-Change-Number: 1261 Gerrit-PatchSet: 2 Gerrit-Owner: flichtenheld Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --B1788fh5hqY= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 sub= mitted this change.

View Change

options_util: Fix conversion warning in atoi_con=
strained

The whole purpose of the function is to make sure
that c= ast is safe.

Change-Id: Id08524661aa5bcc5cd42f27a1aacc636e2b2b004Signed-off-by: Frank Lichtenheld <frank@...2641...>
Acked-by: Ger= t Doering <gert@...1296...>
Gerrit URL: https://gerrit.openvpn.net= /c/openvpn/+/1261
Message-Id: <20251008170202.10333-1-gert@...1296...= >
URL: https://sourceforge.net/p/openvpn/mailman/message/59244107/Signed-off-by: Gert Doering <gert@...1296...>
---
M src/openvp= n/options_util.c
1 file changed, 1 insertion(+), 10 deletions(-)

=
diff --git a/src/openvpn/options_util.c b/src/openvpn/options_util.c
index 8a1c083..eba7d39 100644
--- a/src/openvp= n/options_util.c
+++ b/src/openvpn/options_util.c@@ -162,11 +162,6 @@
return (int)i;
<= span> }

-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wconv= ersion"
-#endif
-
bool
atoi_constrained(const char *str, int *value, const char *n= ame, 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 diagnostic pop
-#endif
-
static const char *updatable_options[] =3D = { "block-ipv6", "block-outside-dns",
= "dhcp-option", "dn= s",
"= ifconfig", "ifconfig-ipv6",

To view, visit change 1261. To unsubscribe, or for help writing mail filter= s, visit setting= s.

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Id08524661aa5bcc5cd42f27a1aa= cc636e2b2b004
Gerrit-Change-Number: 1261
Gerrit-PatchSet: 2
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>
= --B1788fh5hqY=--