kjdev / php-ext-brotli

Brotli Extension for PHP
MIT License
177 stars 29 forks source link

build of 0.15.1 on 32-bit fails #54

Closed andypost closed 3 weeks ago

andypost commented 3 weeks ago

Upgrading package for Alpinelinux and all 32-bit arches failed in CI but also has a lot of warnings about 32-bit checks The meaningful part of log

n file included from /usr/include/php81/Zend/zend_types.h:25,
                 from /usr/include/php81/Zend/zend.h:27,
                 from /usr/include/php81/main/php.h:31,
                 from /builds/alpine/aports/testing/php81-pecl-brotli/src/brotli-0.15.1/brotli.c:5:
/builds/alpine/aports/testing/php81-pecl-brotli/src/brotli-0.15.1/brotli.c: In function 'zif_brotli_compress':
/usr/include/php81/Zend/zend_API.h:1646:59: error: passing argument 2 of 'zend_parse_arg_long' from incompatible pointer type [-Wincompatible-pointer-types]
 1646 |                 if (UNEXPECTED(!zend_parse_arg_long(_arg, &dest, &is_null, check_null, _i))) { \

/usr/include/php81/Zend/zend_portability.h:338:52: note: in definition of macro 'UNEXPECTED'
  338 | # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
      |                                                    ^~~~~~~~~
/usr/include/php81/Zend/zend_API.h:1653:9: note: in expansion of macro 'Z_PARAM_LONG_EX'
 1653 |         Z_PARAM_LONG_EX(dest, _dummy, 0, 0)
      |         ^~~~~~~~~~~~~~~
/builds/alpine/aports/testing/php81-pecl-brotli/src/brotli-0.15.1/brotli.c:999:9: note: in expansion of macro 'Z_PARAM_LONG'
  999 |         Z_PARAM_LONG(quality)
      |         ^~~~~~~~~~~~
In file included from /usr/include/php81/main/php.h:35:
/usr/include/php81/Zend/zend_API.h:1947:74: note: expected 'zend_long *' {aka 'int *'} but argument is of type 'long int *'
 1947 | static zend_always_inline bool zend_parse_arg_long(zval *arg, zend_long *dest, bool *is_null, bool check_null, uint32_t arg_num)
      |                                                               ~~~~~~~~~~~^~~~
...
make: *** [Makefile:209: brotli.lo] Error 1
kjdev commented 3 weeks ago

https://github.com/kjdev/php-ext-brotli/commit/e08c70259b7137e78b6f2c4d103982a2c61edd79: Fixed. We have not released it, but can you confirm it?

andypost commented 3 weeks ago

Thank you! allowed to build and the only warning left on 32-bits is

/builds/alpine/aports/testing/php81-pecl-brotli/src/brotli-0.15.1/brotli.c: In function 'brotli_apc_unserializer':
/builds/alpine/aports/testing/php81-pecl-brotli/src/brotli-0.15.1/brotli.c:1356:45: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'int' [-Wformat=]
 1356 |                          "Error at offset %ld of %ld bytes",
      |                                           ~~^
      |                                             |
      |                                             long int
      |                                           %d
 1357 |                          (zend_long) ((char*) tmp - ZSTR_VAL(out.s)),
      |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                          |
      |                          int
/builds/alpine/aports/testing/php81-pecl-brotli/src/brotli-0.15.1/brotli.c:1356:52: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'int' [-Wformat=]
 1356 |                          "Error at offset %ld of %ld bytes",
      |                                                  ~~^
      |                                                    |
      |                                                    long int
      |                                                  %d
kjdev commented 3 weeks ago

Thank you for confirming.

I didn't check the code in the apcu support section.

I will fix it additionally.

kjdev commented 3 weeks ago

https://github.com/kjdev/php-ext-brotli/commit/5b54117f47ff3318710b58e97c7808c35e58bbdb: Additional fixed. Please check again.

andypost commented 3 weeks ago

Great! no more warnings! Thank you and looking for new release

kjdev commented 3 weeks ago

new release: 0.15.2