Skip to content

Fix incompatible pointer types (32-bit) #555

New issue

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

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

Already on GitHub? # to your account

Merged
merged 1 commit into from
Sep 26, 2024
Merged

Fix incompatible pointer types (32-bit) #555

merged 1 commit into from
Sep 26, 2024

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

@m6w6 m6w6 merged commit 899f0d5 into master Sep 26, 2024
m6w6 added a commit that referenced this pull request Sep 26, 2024
- Add #515 option to locally enforce payload size limit
- Add #539 zstd support
- Add #540 compression_level option
- Mark password as a sensitive param for PHP 8.2
- Fix Windows PHP 8 compatibility
- Fix #518 Windows msgpack support
- Fix #522 signed integer overflow
- Fix #523 incorrect PHP reflection type for Memcached::cas $cas_token
- Fix #546 don't check key automatically, unless client-side verify_key is enabled
- Fix #555 incompatible pointer types (32-bit)
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants