| Message ID | 20251008170202.10333-1-gert@greenie.muc.de |
|---|---|
| State | New |
| Headers | show |
| Series | [Openvpn-devel,v1] options_util: Fix conversion warning in atoi_constrained | expand |
Trivial and definitely save :-) not tested beyond "BB all green".
Your patch has been applied to the master branch.
commit 5ec23295f03bec3e241f65363bcd0f5b0b2afde6
Author: Frank Lichtenheld
Date: Wed Oct 8 19:01:57 2025 +0200
options_util: Fix conversion warning in atoi_constrained
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1261
Message-Id: <20251008170202.10333-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/search?l=mid&q=20251008170202.10333-1-gert@greenie.muc.de
Signed-off-by: Gert Doering <gert@greenie.muc.de>
--
kind regards,
Gert Doering
Hi, On Thu, Oct 09, 2025 at 04:50:22PM +0200, Gert Doering wrote: > Trivial and definitely save :-) not tested beyond "BB all green". > > Your patch has been applied to the master branch. > > commit 5ec23295f03bec3e241f65363bcd0f5b0b2afde6 > Author: Frank Lichtenheld > Date: Wed Oct 8 19:01:57 2025 +0200 Or not... wrong mail archive URL, corrected, did not adjust the mail. This is what I will push now: commit 8fd8c4fa5d6c113925ebf42d47d9e8d3f292309f (HEAD -> master) Author: Frank Lichtenheld <frank@lichtenheld.com> Date: Wed Oct 8 19:01:57 2025 +0200 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 <frank@lichtenheld.com> Acked-by: Gert Doering <gert@greenie.muc.de> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1261 Message-Id: <20251008170202.10333-1-gert@greenie.muc.de> URL: https://sourceforge.net/p/openvpn/mailman/message/59244107/ Signed-off-by: Gert Doering <gert@greenie.muc.de> (same commit, different URL: in the message -> different ID) sorry, gert
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, int max, msglvl_t msglevel) { @@ -194,14 +189,10 @@ return false; } - *value = i; + *value = (int)i; return true; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - static const char *updatable_options[] = { "block-ipv6", "block-outside-dns", "dhcp-option", "dns", "ifconfig", "ifconfig-ipv6",