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 incompatible pointer types (32-bit) #555

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

remicollet
Copy link
Collaborator

This is now an error (GCC 14 on Fedora 40), and indeed a real problem

/builddir/build/BUILD/php-pecl-memcached-3.2.0/NTS/php_memcached.c: In function 's_compress_value':
/builddir/build/BUILD/php-pecl-memcached-3.2.0/NTS/php_memcached.c:903:65: error: passing argument 2 of 'compress' from incompatible pointer type [-Wincompatible-pointer-types]
  903 |                         int status = compress((Bytef *) buffer, &compressed_size, (Bytef *) ZSTR_VAL(payload), ZSTR_LEN(payload));
      |                                                                 ^~~~~~~~~~~~~~~~
      |                                                                 |
      |                                                                 size_t * {aka unsigned int *}
In file included from /builddir/build/BUILD/php-pecl-memcached-3.2.0/NTS/php_memcached.c:38:
/usr/include/zlib.h:1215:68: note: expected 'long unsigned int *' but argument is of type 'size_t *' {aka 'unsigned int *'}
 1215 | Z_EXTERN int Z_EXPORT compress(unsigned char *dest, unsigned long *destLen, const unsigned char *source, unsigned long sourceLen);
      |                                                     ~~~~~~~~~~~~~~~^~~~~~~
/builddir/build/BUILD/php-pecl-memcached-3.2.0/NTS/php_memcached.c: In function 's_decompress_value':
/builddir/build/BUILD/php-pecl-memcached-3.2.0/NTS/php_memcached.c:3636:72: error: passing argument 2 of 'uncompress' from incompatible pointer type [-Wincompatible-pointer-types]
 3636 |                 decompress_status = (uncompress((Bytef *) buffer->val, &buffer->len, (Bytef *)payload, payload_len) == Z_OK);
      |                                                                        ^~~~~~~~~~~~
      |                                                                        |
      |                                                                        size_t * {aka unsigned int *}
/usr/include/zlib.h:1251:70: note: expected 'long unsigned int *' but argument is of type 'size_t *' {aka 'unsigned int *'}
 1251 | Z_EXTERN int Z_EXPORT uncompress(unsigned char *dest, unsigned long *destLen, const unsigned char *source, unsigned long sourceLen);
      |                                                       ~~~~~~~~~~~~~~~^~~~~~~

@remicollet
Copy link
Collaborator Author

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

1 participant