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]: lots of compiling warning for PHP 8.2 using PECL #16401

Closed
dugwood opened this issue Aug 14, 2023 · 2 comments
Closed

[BUG]: lots of compiling warning for PHP 8.2 using PECL #16401

dugwood opened this issue Aug 14, 2023 · 2 comments
Assignees
Labels
duplicate Duplicate issue. The duplicate issue is referenced in the comments enhancement Enhancement to the framework external dependency This issue depends on external issue to be resolved. not a bug Reported issue is not a bug

Comments

@dugwood
Copy link
Contributor

dugwood commented Aug 14, 2023

Describe the bug
There's a lot of errors while building the extension through PECL. In the past, I've just seen a few, so I've ignored these.

To Reproduce
pecl install phalcon

Example of warnings:

/tmp/pear/temp/phalcon/phalcon.zep.c: In function 'zephir_function_exists':
/tmp/pear/temp/phalcon/phalcon.zep.c:4074:108: warning: comparison between pointer and integer
 4074 |         if (zend_hash_str_exists(CG(function_table), Z_STRVAL_P(function_name), Z_STRLEN_P(function_name)) != NULL) {
      |                                                                                                            ^~
/tmp/pear/temp/phalcon/phalcon.zep.c: In function 'zephir_function_exists_ex':
/tmp/pear/temp/phalcon/phalcon.zep.c:4083:83: warning: comparison between pointer and integer
 4083 |         if (zend_hash_str_exists(CG(function_table), function_name, function_len) != NULL) {
      |                                                                                   ^~
/tmp/pear/temp/phalcon/phalcon.zep.c: In function 'zephir_require_ret':
/tmp/pear/temp/phalcon/phalcon.zep.c:9142:19: warning: passing argument 1 of 'zval_ptr_dtor' from incompatible pointer type [-Wincompatible-pointer-types]
 9142 |     zval_ptr_dtor(zend_string_path);
      |                   ^~~~~~~~~~~~~~~~
      |                   |
      |                   zend_string * {aka struct _zend_string *}
In file included from /usr/include/php/20220829/Zend/zend.h:36,
                 from /usr/include/php/20220829/main/php.h:31,
                 from /tmp/pear/temp/phalcon/phalcon.zep.c:46:
/usr/include/php/20220829/Zend/zend_variables.h:79:35: note: expected 'zval *' {aka 'struct _zval_struct *'} but argument is of type 'zend_string *' {aka 'struct _zend_string *'}
   79 | ZEND_API void zval_ptr_dtor(zval *zval_ptr);
      |                             ~~~~~~^~~~~~~~
/tmp/pear/temp/phalcon/phalcon.zep.c: In function 'zephir_require_once_ret':
/tmp/pear/temp/phalcon/phalcon.zep.c:9212:19: warning: passing argument 1 of 'zval_ptr_dtor' from incompatible pointer type [-Wincompatible-pointer-types]
 9212 |     zval_ptr_dtor(zend_string_path);
      |                   ^~~~~~~~~~~~~~~~
      |                   |
      |                   zend_string * {aka struct _zend_string *}
/usr/include/php/20220829/Zend/zend_variables.h:79:35: note: expected 'zval *' {aka 'struct _zval_struct *'} but argument is of type 'zend_string *' {aka 'struct _zend_string *'}
   79 | ZEND_API void zval_ptr_dtor(zval *zval_ptr);
      |                             ~~~~~~^~~~~~~~
/tmp/pear/temp/phalcon/phalcon.zep.c: In function 'zephir_file_exists':
/tmp/pear/temp/phalcon/phalcon.zep.c:9314:23: warning: passing argument 1 of 'zval_ptr_dtor' from incompatible pointer type [-Wincompatible-pointer-types]
 9314 |         zval_ptr_dtor(file);
      |                       ^~~~
      |                       |
      |                       zend_string * {aka struct _zend_string *}
/usr/include/php/20220829/Zend/zend_variables.h:79:35: note: expected 'zval *' {aka 'struct _zval_struct *'} but argument is of type 'zend_string *' {aka 'struct _zend_string *'}
   79 | ZEND_API void zval_ptr_dtor(zval *zval_ptr);
      |                             ~~~~~~^~~~~~~~
/tmp/pear/temp/phalcon/phalcon.zep.c: In function 'zephir_filemtime':
/tmp/pear/temp/phalcon/phalcon.zep.c:9537:31: warning: passing argument 1 of 'zval_ptr_dtor' from incompatible pointer type [-Wincompatible-pointer-types]
 9537 |                 zval_ptr_dtor(file);
      |                               ^~~~
      |                               |
      |                               zend_string * {aka struct _zend_string *}
/usr/include/php/20220829/Zend/zend_variables.h:79:35: note: expected 'zval *' {aka 'struct _zval_struct *'} but argument is of type 'zend_string *' {aka 'struct _zend_string *'}
   79 | ZEND_API void zval_ptr_dtor(zval *zval_ptr);
      |                             ~~~~~~^~~~~~~~
In file included from /usr/include/php/20220829/Zend/zend_types.h:25,
                 from /usr/include/php/20220829/Zend/zend.h:27:
/tmp/pear/temp/phalcon/phalcon.zep.c: In function 'zim_Phalcon_Tag_displayTo':
/usr/include/php/20220829/Zend/zend_API.h:1943:58: warning: passing argument 2 of 'zend_parse_arg_str' from incompatible pointer type [-Wincompatible-pointer-types]
 1943 |                 if (UNEXPECTED(!zend_parse_arg_str(_arg, &dest, check_null, _i))) { \
/usr/include/php/20220829/Zend/zend_portability.h:364:52: note: in definition of macro 'UNEXPECTED'
  364 | # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
      |                                                    ^~~~~~~~~
/usr/include/php/20220829/Zend/zend_API.h:1950:9: note: in expansion of macro 'Z_PARAM_STR_EX'
 1950 |         Z_PARAM_STR_EX(dest, 0, 0)
      |         ^~~~~~~~~~~~~~
/tmp/pear/temp/phalcon/phalcon.zep.c:14798:17: note: in expansion of macro 'Z_PARAM_STR'
14798 |                 Z_PARAM_STR(id)
      |                 ^~~~~~~~~~~
In file included from /usr/include/php/20220829/main/php.h:35:
/usr/include/php/20220829/Zend/zend_API.h:2112:76: note: expected 'zend_string **' {aka 'struct _zend_string **'} but argument is of type 'zval *' {aka 'struct _zval_struct *'}
 2112 | static zend_always_inline bool zend_parse_arg_str(zval *arg, zend_string **dest, bool check_null, uint32_t arg_num)
      |                                                              ~~~~~~~~~~~~~~^~~~
/tmp/pear/temp/phalcon/phalcon.zep.c: In function 'zim_Phalcon_Tag_friendlyTitle':
/usr/include/php/20220829/Zend/zend_API.h:1943:58: warning: passing argument 2 of 'zend_parse_arg_str' from incompatible pointer type [-Wincompatible-pointer-types]
 1943 |                 if (UNEXPECTED(!zend_parse_arg_str(_arg, &dest, check_null, _i))) { \
/usr/include/php/20220829/Zend/zend_portability.h:364:52: note: in definition of macro 'UNEXPECTED'
  364 | # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
      |                                                    ^~~~~~~~~
/usr/include/php/20220829/Zend/zend_API.h:1950:9: note: in expansion of macro 'Z_PARAM_STR_EX'
 1950 |         Z_PARAM_STR_EX(dest, 0, 0)
      |         ^~~~~~~~~~~~~~
/tmp/pear/temp/phalcon/phalcon.zep.c:14982:17: note: in expansion of macro 'Z_PARAM_STR'
14982 |                 Z_PARAM_STR(text)
      |                 ^~~~~~~~~~~

Expected behavior
Not a lot of warnings :-)

Details

  • Phalcon version: 5.2.3
  • PHP Version: 8.2.7
  • Operating System: Debian Bookworm (12)
  • Installation type: Compiling from source (PECL)
  • Zephir version (if any):
  • Server: Other (irrelevant)
@dugwood dugwood added bug A bug report status: unverified Unverified labels Aug 14, 2023
@Jeckerson
Copy link
Member

Those are compilation warnings that need to be adjusted inside Zephir. But in general, just ignore them.

I'll see what might be possible to do inside Zephir to remove some of them.

@Jeckerson Jeckerson added not a bug Reported issue is not a bug enhancement Enhancement to the framework duplicate Duplicate issue. The duplicate issue is referenced in the comments external dependency This issue depends on external issue to be resolved. and removed bug A bug report status: unverified Unverified labels Aug 14, 2023
@Jeckerson Jeckerson self-assigned this Aug 14, 2023
@dugwood
Copy link
Contributor Author

dugwood commented Aug 14, 2023

Thanks @Jeckerson , I thought it was triggered by phalcon.zep code.

I'm waiting for #16263 also, which may need some rewrites in the Zephir language too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Duplicate issue. The duplicate issue is referenced in the comments enhancement Enhancement to the framework external dependency This issue depends on external issue to be resolved. not a bug Reported issue is not a bug
Projects
None yet
Development

No branches or pull requests

2 participants