Skip to content

Commit 17aa2de

Browse files
committed
Fix compiler warning with GCC 16: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
1 parent cbe6eb3 commit 17aa2de

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

ext/mysqlnd/mysqlnd_connection.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, get_scheme)(MYSQLND_CONN_DATA * conn, MYSQLND_
550550
/* IPv6 without square brackets so without port */
551551
transport.l = mnd_sprintf(&transport.s, 0, "tcp://[%s]:%u", hostname.s, port);
552552
} else {
553-
char *p;
553+
const char *p;
554554

555555
/* IPv6 addresses are in the format [address]:port */
556556
if (hostname.s[0] == '[') { /* IPv6 */

ext/mysqlnd/mysqlnd_wireprotocol.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ php_mysqlnd_greet_read(MYSQLND_CONN_DATA * conn, void * _packet)
459459
packet->auth_protocol = estrdup("");
460460
} else {
461461
/* Check if NUL present */
462-
char *null_terminator = memchr(p, '\0', remaining_size);
462+
const char *null_terminator = memchr(p, '\0', remaining_size);
463463
size_t auth_protocol_len;
464464
if (null_terminator) {
465465
/* If present, do basically estrdup */

0 commit comments

Comments
 (0)