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]: [-Wincompatible-pointer-types] build warning [5.0.0alpha7] #15792

Open
remicollet opened this issue Nov 17, 2021 · 5 comments
Open

[BUG]: [-Wincompatible-pointer-types] build warning [5.0.0alpha7] #15792

remicollet opened this issue Nov 17, 2021 · 5 comments
Labels
bug A bug report status: unverified Unverified

Comments

@remicollet
Copy link
Contributor

In various place:

In file included from /usr/include/php/Zend/zend_types.h:25,
                 from /usr/include/php/Zend/zend.h:27,
                 from /usr/include/php/main/php.h:31,
                 from /builddir/build/BUILD/php-phalcon5-5.0.0~alpha7/NTS/phalcon.zep.c:46:
/builddir/build/BUILD/php-phalcon5-5.0.0~alpha7/NTS/phalcon.zep.c: In function 'zim_Phalcon_Cache_Cache_checkKey':
/usr/include/php/Zend/zend_API.h:1775:44: warning: passing argument 2 of 'zend_parse_arg_str' from incompatible pointer type [-Wincompatible-pointer-types]
   if (UNEXPECTED(!zend_parse_arg_str(_arg, &dest, check_null))) { \
/usr/include/php/Zend/zend_portability.h:325:52: note: in definition of macro 'UNEXPECTED'
 # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
                                                    ^~~~~~~~~
/usr/include/php/Zend/zend_API.h:1782:2: note: in expansion of macro 'Z_PARAM_STR_EX2'
  Z_PARAM_STR_EX2(dest, check_null, separate, separate)
  ^~~~~~~~~~~~~~~
/usr/include/php/Zend/zend_API.h:1785:2: note: in expansion of macro 'Z_PARAM_STR_EX'
  Z_PARAM_STR_EX(dest, 0, 0)
  ^~~~~~~~~~~~~~
/builddir/build/BUILD/php-phalcon5-5.0.0~alpha7/NTS/phalcon.zep.c:221588:3: note: in expansion of macro 'Z_PARAM_STR'
   Z_PARAM_STR(key)
   ^~~~~~~~~~~
In file included from /usr/include/php/main/php.h:35,
                 from /builddir/build/BUILD/php-phalcon5-5.0.0~alpha7/NTS/phalcon.zep.c:46:
/usr/include/php/Zend/zend_API.h:1947:76: note: expected 'zend_string **' {aka 'struct _zend_string **'} but argument is of type 'zval *' {aka 'struct _zval_struct *'}

In code we have

	zval key;
        ...
		Z_PARAM_STR(key)

So key should be a zend_string.

@remicollet remicollet added bug A bug report status: unverified Unverified labels Nov 17, 2021
@remicollet remicollet changed the title [BUG]: [-Wincompatible-pointer-types] build warning [BUG]: [-Wincompatible-pointer-types] build warning [5.0.0alpha7] Nov 17, 2021
@remicollet
Copy link
Contributor Author

Notice: build from the git tag (the content of the phalcon-pecl.tgz asset seems very different)

@Jeckerson
Copy link
Member

Relates to zephir-lang/zephir#1902

@remicollet
Copy link
Contributor Author

remicollet commented Nov 17, 2021

I don't think this is related to linked issue, which is about refactoring to take benefit of zend_string usage

This one is about a bad pointer cast, a zval cannot be used where a zend_string is expected, so a real issue.

@Jeckerson
Copy link
Member

Jeckerson commented Nov 17, 2021

@remicollet Zephir's issue mentioned before, will be used as reference to review and refactor of char, zval and zend_string structs.

@Jeckerson
Copy link
Member

Blocked by zephir-lang/zephir#2326

@phalcon phalcon deleted a comment from glailsile33 May 12, 2022
@niden niden added this to Phalcon v5 Jul 31, 2023
@niden niden moved this to Backlog in Phalcon v5 Jul 31, 2023
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
Status: Backlog
Development

No branches or pull requests

2 participants