Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
remicollet opened this issue Feb 16, 2024 · 5 comments
Open

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

remicollet opened this issue Feb 16, 2024 · 5 comments
Assignees
Labels
bug A bug report status: unverified Unverified

Comments

@remicollet
Copy link
Contributor

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

@Jeckerson
Copy link
Member

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

@remicollet
Copy link
Contributor Author

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

@stfast
Copy link

stfast commented Apr 29, 2024

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?

@remicollet
Copy link
Contributor Author

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

@stfast
Copy link

stfast commented Apr 30, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug report status: unverified Unverified
Projects
None yet
Development

No branches or pull requests

3 participants