From: Frank Lichtenheld Date: Sat, 13 Dec 2025 08:42:18 +0000 (+0100) Subject: options: Avoid some conversion warnings X-Git-Tag: v2.7_rc4~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a9c8a8cd6f50c27a8295a169fd14ccf92ee92ac;p=thirdparty%2Fopenvpn.git options: Avoid some conversion warnings Just use the correct types. Change-Id: I02db40d7335df7ab037ae1deb3e20f25a9b199bd Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1440 Message-Id: <20251213084225.30988-1-gert@greenie.muc.de> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg35061.html Signed-off-by: Gert Doering --- diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 24c3e9215..34af0d31d 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -1154,13 +1154,8 @@ ipv6_addr_safe_hexplusbits(const char *ipv6_prefix_spec) return get_ipv6_addr(ipv6_prefix_spec, &t_addr, &t_bits, M_WARN); } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - static char * -string_substitute(const char *src, int from, int to, struct gc_arena *gc) +string_substitute(const char *src, char from, char to, struct gc_arena *gc) { char *ret = (char *)gc_malloc(strlen(src) + 1, true, gc); char *dest = ret; @@ -9306,10 +9301,6 @@ err: gc_free(&gc); } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - bool has_udp_in_local_list(const struct options *options) { diff --git a/src/openvpn/options.h b/src/openvpn/options.h index 555d9dd66..0561c2563 100644 --- a/src/openvpn/options.h +++ b/src/openvpn/options.h @@ -801,7 +801,7 @@ struct pull_filter #define PUF_TYPE_IGNORE 2 /**< filter type to ignore a matching option */ #define PUF_TYPE_REJECT 3 /**< filter type to reject and trigger SIGUSR1 */ int type; - int size; + size_t size; char *pattern; struct pull_filter *next; };