From: "flichtenheld (Code Review)" Date: Fri, 12 Dec 2025 18:15:54 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="YsdoVhMA8VY="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: options: Avoid some conversion warnings List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --YsdoVhMA8VY= 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/+/1440?usp=3Demail to review the following change. Change subject: options: Avoid some conversion warnings ...................................................................... options: Avoid some conversion warnings Just use the correct types. Change-Id: I02db40d7335df7ab037ae1deb3e20f25a9b199bd Signed-off-by: Frank Lichtenheld --- M src/openvpn/options.c M src/openvpn/options.h 2 files changed, 2 insertions(+), 11 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/40/1440/1 diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 24c3e92..34af0d3 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -1154,13 +1154,8 @@ 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 =3D (char *)gc_malloc(strlen(src) + 1, true, gc); char *dest =3D ret; @@ -9306,10 +9301,6 @@ 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 555d9dd..0561c25 100644 --- a/src/openvpn/options.h +++ b/src/openvpn/options.h @@ -801,7 +801,7 @@ #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; }; -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1440?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: I02db40d7335df7ab037ae1deb3e20f25a9b199bd Gerrit-Change-Number: 1440 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos --YsdoVhMA8VY= 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: Avoid some conversion warnings
=
Just use the correct types.

Change-Id: I02db40d7335df7ab037ae1de= b3e20f25a9b199bd
Signed-off-by: Frank Lichtenheld <frank@...2641...&g= t;
---
M src/openvpn/options.c
M src/openvpn/options.h
2 files = changed, 2 insertions(+), 11 deletions(-)

git pu=
ll ssh://gerrit.openvpn.net:29418/openvpn refs/changes/40/1440/1
di=
ff --git a/src/openvpn/options.c b/src/openvpn/options.c
in= dex 24c3e92..34af0d3 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -1154,13 +1154,= 8 @@
return get_ipv6_addr(ipv6_prefix_spec, &t_add= r, &t_bits, M_WARN);
}

-#if defined(__GNUC__) || defined(__= clang__)

-#pragma GCC d= iagnostic 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 =3D (char *)gc_malloc(s= trlen(src) + 1, true, gc);
char *dest =3D ret;<= br>@@ -9306,10 +9301,6 @@
gc_free(&gc);
}

-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif

-
bool
has_udp_in_l= ocal_list(const struct options *options)
{
diff --git a/src/openvpn/options.h b/src/openvpn/options.h
index 555d9dd..0561c25 100644
--- a/src/openvpn/options.h<= /span>
+++ b/src/openvpn/options.h
@@ -801,7 +801,= 7 @@
#define PUF_TYPE_IGNORE 2 /**< filter type to igno= re a matching option */
#define PUF_TYPE_REJECT 3 /**< = filter type to reject and trigger SIGUSR1 */
int type;=
- int size;<= br>+ size_t size;
= char *pattern;
struct pull_filter *next;
};

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

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I02db40d7335df7ab037ae1deb3e= 20f25a9b199bd
Gerrit-Change-Number: 1440
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...>
= --YsdoVhMA8VY=--