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

Fix for PHP 7.3 #190

Closed
wants to merge 1 commit into from
Closed

Fix for PHP 7.3 #190

wants to merge 1 commit into from

Conversation

remicollet
Copy link
Contributor

No description provided.

GC_REFCOUNT(&le) = 1;
#else
GC_SET_REFCOUNT(&le, 1);
#endif
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From UPGRADING.INTERNALS

  f. GC_REFCOUNT() is turned into inline function and can't be modified direcly.
     All reference-counting operations should be done through corresponding
     macros GC_SET_REFCOUNT(), GC_ADDREF() and GC_DELREF().

     GC_REFCOUNT(p)++ should be changed into GC_ADDREF(p),
     GC_REFCOUNT(p)-- into GC_DELREF(p),
     GC_REFCOUNT(p) = 1 into GC_SET_REFCOUNT(p, 1).

@@ -63,7 +63,7 @@ char *php_zmq_printable_func (zend_fcall_info *fci, zend_fcall_info_cache *fci_c
char *buffer = NULL;

if (fci->object) {
spprintf (&buffer, 0, "%s::%s", fci->object->ce->name->val, fci_cache->function_handler->common.function_name);
spprintf (&buffer, 0, "%s::%s", fci->object->ce->name->val, ZSTR_VAL(fci_cache->function_handler->common.function_name));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a zend_string since 7.0.

PHP 7.3 now nicely raise -Wformat warning about this

@@ -169,7 +169,7 @@ static
zend_string *s_create_key(zval *entry)
{
if (Z_TYPE_P(entry) == IS_RESOURCE) {
return strpprintf(0, "r:%ld", Z_RES_P(entry)->handle);
return strpprintf(0, "r:%d", Z_RES_P(entry)->handle);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-Wformat again, hadle is an int

@@ -222,7 +222,7 @@ size_t php_zmq_pollset_num_items(php_zmq_pollset *set)
zend_string *php_zmq_pollset_add(php_zmq_pollset *set, zval *entry, int events, int *error)
{
zend_string *key;
size_t num_items, index;
size_t index;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-Wunused-but-set-variable

@remicollet
Copy link
Contributor Author

Notice: this only fix the build, there is something wrong, test suite segfault in various test...

@edhelas
Copy link

edhelas commented Nov 7, 2018

Is there some updates regarding this PR? The currently packaged version in Debian of PHP is 7.3 and it's not working anymore with the php-zmq package.

@edhelas
Copy link

edhelas commented Nov 15, 2018

I applied your patch and tried with Movim, still having a zend_mm_heap corrupted when using php-zmq.

@remicollet
Copy link
Contributor Author

pr #193 is better

@remicollet remicollet closed this Dec 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants