From: "cron2 (Code Review)" Date: Thu, 19 Feb 2026 10:00:40 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="n9mW0gS/tGY="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: dns: fix discards 'const' qualifier from pointer target type List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld , plaisthos Cc: openvpn-devel --n9mW0gS/tGY= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#2) to the change originally created by= flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1542?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by cron2 Change subject: dns: fix discards 'const' qualifier from pointer target type ...................................................................... dns: fix discards 'const' qualifier from pointer target type Since glibc-2.43: For ISO C23, the functions bsearch, memchr, strchr, strpbrk, strrchr, strstr, wcschr, wcspbrk, wcsrchr, wcsstr and wmemchr that return pointers into their input arrays now have definitions as macros that return a pointer to a const-qualified type when the input argument is a pointer to a const-qualified type. fixes: src/openvpn/dns.c: In function 'dns_server_addr_parse': src/openvpn/dns.c:67:25: warning: initialization discards 'const' quali= fier from pointer target type [-Wdiscarded-qualifiers] 67 | char *first_colon =3D strchr(addr, ':'); | ^~~~~~ src/openvpn/dns.c:68:24: warning: initialization discards 'const' quali= fier from pointer target type [-Wdiscarded-qualifiers] 68 | char *last_colon =3D strrchr(addr, ':'); | ^~~~~~~ Change-Id: I262705189edfbd9aa9a32bcd712840fffa592435 Signed-off-by: Rudi Heitbaum Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1542 Acked-by: Frank Lichtenheld Message-Id: <20260218214738.27158-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg35= 730.html Signed-off-by: Gert Doering --- M src/openvpn/dns.c 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/42/1542/2 diff --git a/src/openvpn/dns.c b/src/openvpn/dns.c index 3d24050..747c0db 100644 --- a/src/openvpn/dns.c +++ b/src/openvpn/dns.c @@ -45,7 +45,7 @@ * @return True if parsing was successful */ static bool -dns_server_port_parse(in_port_t *port, char *port_str) +dns_server_port_parse(in_port_t *port, const char *port_str) { char *endptr; errno =3D 0; @@ -71,8 +71,8 @@ in_port_t port =3D 0; sa_family_t af; - char *first_colon =3D strchr(addr, ':'); - char *last_colon =3D strrchr(addr, ':'); + const char *first_colon =3D strchr(addr, ':'); + const char *last_colon =3D strrchr(addr, ':'); if (!first_colon || first_colon =3D=3D last_colon) { @@ -93,7 +93,7 @@ if (addr[0] =3D=3D '[') { addr +=3D 1; - char *bracket =3D last_colon - 1; + const char *bracket =3D last_colon - 1; if (*bracket !=3D ']' || bracket =3D=3D addr || !dns_server_po= rt_parse(&port, last_colon + 1)) { return false; -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1542?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newpatchset Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I262705189edfbd9aa9a32bcd712840fffa592435 Gerrit-Change-Number: 1542 Gerrit-PatchSet: 2 Gerrit-Owner: flichtenheld Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --n9mW0gS/tGY= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 upl= oaded patch set #2 to the change originally created by flichtenhel= d.

View Change

The following approvals got outdated and were remove= d: Code-Review+2 by cron2

dns: fix discards 'const' q=
ualifier from pointer target type

Since glibc-2.43:

For ISO C= 23, the functions bsearch, memchr, strchr, strpbrk, strrchr,
strstr, wcs= chr, wcspbrk, wcsrchr, wcsstr and wmemchr that return pointers
into thei= r input arrays now have definitions as macros that return a
pointer to a= const-qualified type when the input argument is a pointer
to a const-qu= alified type.

fixes:
src/openvpn/dns.c: In function 'dns_= server_addr_parse':
src/openvpn/dns.c:67:25: warning: initializa= tion discards 'const' qualifier from pointer target type [-Wdiscard= ed-qualifiers]
67 | char *first_colon =3D strchr(addr, ':= ');
| ^~~~~~
src/openvpn/dn= s.c:68:24: warning: initialization discards 'const' qualifier from = pointer target type [-Wdiscarded-qualifiers]
68 | char *last_= colon =3D strrchr(addr, ':');
| = ^~~~~~~

Change-Id: I262705189edfbd9aa9a32bcd712840fffa592435
Sig= ned-off-by: Rudi Heitbaum <rudi@...2993...>
Acked-by: Gert Doering= <gert@...1296...>
Gerrit URL: https://gerrit.openvpn.net/c/openvp= n/+/1542
Acked-by: Frank Lichtenheld <frank@...2641...>
Message= -Id: <20260218214738.27158-1-gert@...1296...>
URL: https://www.mai= l-archive.com/openvpn-devel@lists.sourceforge.net/msg35730.html
Signed-o= ff-by: Gert Doering <gert@...1296...>
---
M src/openvpn/dns.c1 file changed, 4 insertions(+), 4 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/42/1542/2<=
/pre>
-dns_server_port_parse(in_port_t *port, char *port_str)
+dns_server_port_parse= (in_port_t *port, const char *port_str)
{
= char *endptr;
errno =3D 0;
@@ -71= ,8 +71,8 @@
in_port_t port =3D 0;
= sa_family_t af;

- char *first_colon =3D strchr(addr, ':');- char *last_colon =3D strrch= r(addr, ':');
+ const char *first_colon =3D strchr(addr, ':');
+ const char *last_colon =3D str= rchr(addr, ':');

if (!first_= colon || first_colon =3D=3D last_colon)
{
@@ -93,7 +93,7 @@
if (addr[0] =3D=3D '[= 9;)
{
addr +=3D 1;

- char *bracke= t =3D last_colon - 1;
+ const char *bracket =3D last_colon - 1;
= if (*bracket !=3D ']' || bracket =3D=3D addr || !dns_server= _port_parse(&port, last_colon + 1))
{

return false;

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

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I262705189edfbd9aa9a32bcd712= 840fffa592435
Gerrit-Change-Number: 1542
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>
= --n9mW0gS/tGY=--