phalcon/cphalcon

[BUG]: broken build [-Wincompatible-pointer-types]

Opened this issue · 5 comments

With recent GCC 14 (on Fedora 40)

Build fails with tons of:

/builddir/build/BUILD/php83-php-phalcon5-5.6.1/phalcon-5.6.1/phalcon.zep.c: In function 'zim_Phalcon_Storage_Adapter_Weak_increment':
/opt/remi/php83/root/usr/include/php/Zend/zend_API.h:2059:58: error: passing argument 2 of 'zend_parse_arg_str' from incompatible pointer type [-Wincompatible-pointer-types]
 2059 |                 if (UNEXPECTED(!zend_parse_arg_str(_arg, &dest, check_null, _i))) { \
/opt/remi/php83/root/usr/include/php/Zend/zend_portability.h:363:52: note: in definition of macro 'UNEXPECTED'
  363 | # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
      |                                                    ^~~~~~~~~
/opt/remi/php83/root/usr/include/php/Zend/zend_API.h:2066:9: note: in expansion of macro 'Z_PARAM_STR_EX'
 2066 |         Z_PARAM_STR_EX(dest, 0, 0)
      |         ^~~~~~~~~~~~~~
/builddir/build/BUILD/php83-php-phalcon5-5.6.1/phalcon-5.6.1/phalcon.zep.c:204823:17: note: in expansion of macro 'Z_PARAM_STR'
204823 |                 Z_PARAM_STR(key)
       |                 ^~~~~~~~~~~
/opt/remi/php83/root/usr/include/php/Zend/zend_API.h:2241:76: note: expected 'zend_string **' {aka 'struct _zend_string **'} but argument is of type 'zval *' {aka 'struct _zval_struct *'}
 2241 | static zend_always_inline bool zend_parse_arg_str(zval *arg, zend_string **dest, bool check_null, uint32_t arg_num)
      |                                                              ~~~~~~~~~~~~~~^~~~

Was already reported for a long time.

This was a warning, this in now an error

Yes, I remember your report and issue is still opened - zephir-lang/zephir#2326

There was my attempts during last months to improve it, but it is not trivial task to do. As whole Zephir relies on zval instead of specific types as zend_string or any other. But, there are already improvements in another types, such as zend_bool and zend_long. Which are located in Zephir's development branch.

I'll try to review it in near future...

As whole Zephir relies on zval instead of specific types as zend_string or any other.

If this case, DON'T use Z_PARAM_STR
Instead use Z_PARAM_ZVAL and check Z_TYPE_P(arg) == IS_STRING yourself

Fedora 40 was released a week ago and we would go along with PHP 8.3 in this release.
Are there any timeline to compile phalcon with GCC 14, so we can plan system upgrade?

@stfast notice than on Fedora, you can use my repo which provides more PHP versions and more extensions than in official repository, including phalcon, see https://rpms.remirepo.net/wizard/

Remi I admire your work, great, hard and wonderfull job you you are working, but I've allways had problems with (cycylic) package dependancies with your Remi repos on Fedora upgrades in the past. Thank you reminding me, I will try.