From ed320b500c932aaab3e2abebcba4c7378c8d317c Mon Sep 17 00:00:00 2001 From: Kalle Sommer Nielsen Date: Fri, 31 Jan 2025 22:28:31 +0200 Subject: [PATCH 1/2] Fix C23 syntax for VS16 (CI runs VS22) --- ext/pdo/pdo_stmt.c | 2 +- ext/spl/spl_iterators.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index f803dfe836b10..5e8a52f7e5435 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -640,7 +640,7 @@ static bool pdo_call_fetch_object_constructor(zend_function *constructor, HashTa zval retval_constructor_call; zend_fcall_info fci = { .size = sizeof(zend_fcall_info), - .function_name = {}, + .function_name = { 0 }, .object = Z_OBJ_P(return_value), .retval = &retval_constructor_call, .param_count = 0, diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index 23eb95c4d7ea5..d0491f625529b 100644 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -3086,7 +3086,7 @@ PHP_FUNCTION(iterator_apply) spl_iterator_apply_info apply_info = { .count = 0, .params_ht = NULL, - .fcc = {}, + .fcc = { 0 }, }; /* The HashTable is used to determine positional arguments */ From 8deca2838ca72564cf46de05367a436689e233bd Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Fri, 31 Jan 2025 22:45:03 +0100 Subject: [PATCH 2/2] Fix initializer for older C compilers --- ext/pdo/pdo_stmt.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 5e8a52f7e5435..bf7936f94521d 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -638,15 +638,11 @@ static bool pdo_do_key_pair_fetch(pdo_stmt_t *stmt, enum pdo_fetch_orientation o static bool pdo_call_fetch_object_constructor(zend_function *constructor, HashTable *ctor_args, zval *return_value) { zval retval_constructor_call; - zend_fcall_info fci = { - .size = sizeof(zend_fcall_info), - .function_name = { 0 }, - .object = Z_OBJ_P(return_value), - .retval = &retval_constructor_call, - .param_count = 0, - .params = NULL, - .named_params = ctor_args, - }; + zend_fcall_info fci = { 0 }; + fci.size = sizeof(zend_fcall_info); + fci.object = Z_OBJ_P(return_value); + fci.retval = &retval_constructor_call; + fci.named_params = ctor_args; zend_fcall_info_cache fcc = { .function_handler = constructor, .object = Z_OBJ_P(return_value),