[php-src] PR #19084: Fix empty_fcall_info C++ missing-field-initializers warning

From: Date: Thu, 10 Jul 2025 07:15:08 +0000
Subject: [php-src] PR #19084: Fix empty_fcall_info C++ missing-field-initializers warning
Groups: php.git-pulls 
Request: Send a blank email to git-pulls+get-32385@lists.php.net to get a copy of this message
Pull Request: https://github.com/php/php-src/pull/19084 Author: KaseyJenkins This [commit ](https://github.com/php/php-src/commit/16c4c066f4d395e4e7bcac4be94e40bbabe4ff9c)introduced the following change: ``` #ifndef __cplusplus # define empty_fcall_info (zend_fcall_info) {0} # define empty_fcall_info_cache (zend_fcall_info_cache) {0} #else # define empty_fcall_info zend_fcall_info {0} # define empty_fcall_info_cache zend_fcall_info_cache {0} #endif ``` When it comes to C++ it generates a -Wmissing-field-initializers [warning](https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wmissing-field-initializers), which is different to C, where this option does not warn about the universal zero initializer ‘{ 0 }’. To sort this issue out while still maintaining the expected (compiler) behaviour the empty { } initializer should be employed instead: ``` #ifndef __cplusplus # define empty_fcall_info (zend_fcall_info) {0} # define empty_fcall_info_cache (zend_fcall_info_cache) {0} #else # define empty_fcall_info zend_fcall_info {} # define empty_fcall_info_cache zend_fcall_info_cache {} #endif ``` This is particularly important since -Wmissing-field-initializers is included in -Wextra, which, coupled with -Werror precludes a successful C++ extension build.

« previous php.git-pulls (#32385) next »