Commit ac1390f60eb for php.net

commit ac1390f60ebc03b92e0a14343ff5aea67d4cd6d2
Author: Arnaud Le Blanc <arnaud.lb@gmail.com>
Date:   Tue May 5 11:22:09 2026 +0200

    Fix compiler warning with glibc 2.43 support of C23 const-preserving standard library macros: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]

    See https://sourceware.org/cgit/glibc/commit/?id=cd748a63ab1

    Closes GH-21950

diff --git a/ext/mysqlnd/mysqlnd_alloc.c b/ext/mysqlnd/mysqlnd_alloc.c
index 06971b3487d..3c059f327ac 100644
--- a/ext/mysqlnd/mysqlnd_alloc.c
+++ b/ext/mysqlnd/mysqlnd_alloc.c
@@ -201,7 +201,7 @@ static void _mysqlnd_efree(void *ptr MYSQLND_MEM_D)

 #if PHP_DEBUG
 	{
-		char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR);
+		const char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR);
 		TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename, __zend_lineno);
 	}
 #endif
@@ -232,7 +232,7 @@ static void _mysqlnd_pefree(void *ptr, bool persistent MYSQLND_MEM_D)

 #if PHP_DEBUG
 	{
-		char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR);
+		const char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR);
 		TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename, __zend_lineno);
 	}
 #endif
@@ -264,7 +264,7 @@ static char * _mysqlnd_pememdup(const char * const ptr, size_t length, bool pers

 #if PHP_DEBUG
 	{
-		char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR);
+		const char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR);
 		TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename, __zend_lineno);
 	}
 #endif
@@ -295,7 +295,7 @@ static char * _mysqlnd_pestrndup(const char * const ptr, size_t length, bool per

 #if PHP_DEBUG
 	{
-		char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR);
+		const char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR);
 		TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename, __zend_lineno);
 	}
 #endif
@@ -336,7 +336,7 @@ static char * _mysqlnd_pestrdup(const char * const ptr, bool persistent MYSQLND_
 	TRACE_ALLOC_ENTER(mysqlnd_pestrdup_name);
 #if PHP_DEBUG
 	{
-		char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR);
+		const char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR);
 		TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename, __zend_lineno);
 	}
 #endif
diff --git a/ext/mysqlnd/mysqlnd_connection.c b/ext/mysqlnd/mysqlnd_connection.c
index 9c379448f63..3b51ee66554 100644
--- a/ext/mysqlnd/mysqlnd_connection.c
+++ b/ext/mysqlnd/mysqlnd_connection.c
@@ -552,7 +552,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, get_scheme)(MYSQLND_CONN_DATA * conn, MYSQLND_
 			/* IPv6 without square brackets so without port */
 			transport.l = mnd_sprintf(&transport.s, 0, "tcp://[%s]:%u", hostname.s, port);
 		} else {
-			char *p;
+			const char *p;

 			/* IPv6 addresses are in the format [address]:port */
 			if (hostname.s[0] == '[') { /* IPv6 */
diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c
index 36fd5323373..64c2c796961 100644
--- a/ext/mysqlnd/mysqlnd_wireprotocol.c
+++ b/ext/mysqlnd/mysqlnd_wireprotocol.c
@@ -461,7 +461,7 @@ php_mysqlnd_greet_read(MYSQLND_CONN_DATA * conn, void * _packet)
 			packet->auth_protocol = estrdup("");
 		} else {
 			/* Check if NUL present */
-			char *null_terminator = memchr(p, '\0', remaining_size);
+			const char *null_terminator = memchr(p, '\0', remaining_size);
 			size_t auth_protocol_len;
 			if (null_terminator) {
 				/* If present, do basically estrdup */