Skip to content

Commit 50aebf3

Browse files
committed
Merge branch 'PHP-8.5'
* PHP-8.5: 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] Fix compiler warning with GCC 16: variable 'offset' set but not used [-Werror=unused-but-set-variable=]
2 parents e5fa4ec + ac1390f commit 50aebf3

6 files changed

Lines changed: 12 additions & 14 deletions

File tree

ext/mysqlnd/mysqlnd_alloc.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ static void _mysqlnd_efree(void *ptr MYSQLND_MEM_D)
199199

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

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

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

294294
#if PHP_DEBUG
295295
{
296-
char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR);
296+
const char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR);
297297
TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename, __zend_lineno);
298298
}
299299
#endif
@@ -334,7 +334,7 @@ static char * _mysqlnd_pestrdup(const char * const ptr, bool persistent MYSQLND_
334334
TRACE_ALLOC_ENTER(mysqlnd_pestrdup_name);
335335
#if PHP_DEBUG
336336
{
337-
char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR);
337+
const char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR);
338338
TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename, __zend_lineno);
339339
}
340340
#endif

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_result.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,7 @@ MYSQLND_METHOD(mysqlnd_res, fetch_into)(MYSQLND_RES * result, const unsigned int
990990

991991
HashTable *row_ht = Z_ARRVAL_P(return_value);
992992
MYSQLND_FIELD *field = meta->fields;
993-
for (unsigned i = 0; i < meta->field_count; i++, field++) {
993+
for (unsigned i = 0; i < meta->field_count; i++) {
994994
zval *data = &row_data[i];
995995

996996
if (flags & MYSQLND_FETCH_NUM) {
@@ -1026,10 +1026,9 @@ MYSQLND_METHOD(mysqlnd_res, fetch_row_c)(MYSQLND_RES * result)
10261026
mysqlnd_result_free_prev_data(result);
10271027
if (result->m.fetch_row(result, &row_data, 0, &fetched_anything) == PASS && fetched_anything) {
10281028
unsigned field_count = result->field_count;
1029-
MYSQLND_FIELD *field = result->meta->fields;
10301029

10311030
ret = mnd_emalloc(field_count * sizeof(char *));
1032-
for (unsigned i = 0; i < field_count; i++, field++) {
1031+
for (unsigned i = 0; i < field_count; i++) {
10331032
zval *data = &row_data[i];
10341033
if (Z_TYPE_P(data) != IS_NULL) {
10351034
convert_to_string(data);

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 */

ext/opcache/zend_persist.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,9 +542,8 @@ static void zend_persist_op_array_ex(zend_op_array *op_array, zend_persistent_sc
542542
zend_op *new_opcodes = zend_shared_memdup_put(op_array->opcodes, sizeof(zend_op) * op_array->last);
543543
zend_op *opline = new_opcodes;
544544
zend_op *end = new_opcodes + op_array->last;
545-
int offset = 0;
546545

547-
for (; opline < end ; opline++, offset++) {
546+
for (; opline < end ; opline++) {
548547
#if ZEND_USE_ABS_CONST_ADDR
549548
if (opline->op1_type == IS_CONST) {
550549
opline->op1.zv = (zval*)((char*)opline->op1.zv + ((char*)op_array->literals - (char*)orig_literals));

ext/phar/phar_object.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,9 @@ static void phar_do_404(phar_archive_data *phar, char *fname, size_t fname_len,
349349
/* post-process REQUEST_URI and retrieve the actual request URI. This is for
350350
cases like http://localhost/blah.phar/path/to/file.php/extra/stuff
351351
which calls "blah.phar" file "path/to/file.php" with PATH_INFO "/extra/stuff" */
352-
static void phar_postprocess_ru_web(const char *fname, size_t fname_len, const char *entry, size_t *entry_len, char **ru, size_t *ru_len) /* {{{ */
352+
static void phar_postprocess_ru_web(const char *fname, size_t fname_len, char *entry, size_t *entry_len, char **ru, size_t *ru_len) /* {{{ */
353353
{
354-
const char *e = entry + 1;
354+
char *e = entry + 1;
355355
char *u1 = NULL, *u = NULL, *saveu = NULL;
356356
size_t e_len = *entry_len - 1, u_len = 0;
357357
phar_archive_data *pphar;

0 commit comments

Comments
 (0)