ntlm: fix discards 'const' qualifier from pointer target type
PATCH 2/2 ntlm: 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/ntlm.c: In function 'ntlm_phase_3':
src/openvpn/ntlm.c:241:15: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
241 | separator = strchr(p->up.username, '\\');
| ^
src/openvpn/dns.c +4 -4
@@ -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 =0 ;
@@ -71,8 +71,8 @@ dns_server_addr_parse(struct dns_server *server, const char *addr)in_port_t port =0 ;sa_family_t af; -char *first_colon =strchr (addr,':' ); -char *last_colon =strrchr (addr,':' ); +const char *first_colon =strchr (addr,':' ); +const char *last_colon =strrchr (addr,':' );if (!first_colon || first_colon == last_colon) {
@@ -93,7 +93,7 @@ dns_server_addr_parse(struct dns_server *server, const char *addr)if (addr[0 ] =='[' ) { addr +=1 ; -char *bracket = last_colon -1 ; +const char *bracket = last_colon -1 ;if (*bracket !=']' || bracket == addr || !dns_server_port_parse (&port, last_colon +1 )) {return false;
--- src/openvpn/ntlm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/openvpn/ntlm.c +1 -1
@@ -218,7 +218,7 @@ ntlm_phase_3(const struct http_proxy_info *p, const char *phase_2, struct gc_arechar domain[128 ];char username[128 ]; -char *separator; +const char *separator;ASSERT (strlen (p->up.username) >0 );ASSERT (strlen (p->up.password) >0 );
Signature · 1 line
2.51.0
Hi,
src/openvpn/dns.c
Quoted 20 lines · Rudi Heitbaum via Openvpn-devel
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/ntlm.c: In function 'ntlm_phase_3':
src/openvpn/ntlm.c:241:15: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
241 | separator =strchr(p->up.username, '\\');
| ^Signed-off-by Rudi Heitbaum <[email protected]...>src/openvpn/dns.c +0
-0
Not sure how you managed to send the dns.c patch twice, once with the "ntlm" header...?
Please resend (with a "-v2" tag) and ensure that we get 1x ntlm.c and 1x dns.c :-)
gert
Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you
feed honest figures into a computer, honest figures come out. Never doubted
it myself till I met a computer with a sense of humor."
Robert A. Heinlein, The Moon is a Harsh Mistress
Gert Doering - Munich, Germany [email protected]...