kjdev / php-ext-zstd

Zstd Extension for PHP
MIT License
201 stars 27 forks source link

Few warnings on 32-bit arches #62

Closed andypost closed 5 months ago

andypost commented 10 months ago

Used to build new 0.13.0 release and faced on armv7,x86 following

/bin/sh /builds/alpine/aports/community/php82-pecl-zstd/src/zstd-0.13.0/libtool --mode=compile gcc -I. -I/builds/alpine/aports/community/php82-pecl-zstd/src/zstd-0.13.0 -I/builds/alpine/aports/community/php82-pecl-zstd/src/zstd-0.13.0/include -I/builds/alpine/aports/community/php82-pecl-zstd/src/zstd-0.13.0/main -I/builds/alpine/aports/community/php82-pecl-zstd/src/zstd-0.13.0 -I/usr/include/php82 -I/usr/include/php82/main -I/usr/include/php82/TSRM -I/usr/include/php82/Zend -I/usr/include/php82/ext -I/usr/include/php82/ext/date/lib  -DHAVE_CONFIG_H  -Os -fstack-clash-protection -Wformat -Werror=format-security -D_GNU_SOURCE    -DZEND_COMPILE_DL_EXT=1 -c /builds/alpine/aports/community/php82-pecl-zstd/src/zstd-0.13.0/zstd.c -o zstd.lo  -MMD -MF zstd.dep -MT zstd.lo
mkdir .libs
 gcc -I. -I/builds/alpine/aports/community/php82-pecl-zstd/src/zstd-0.13.0 -I/builds/alpine/aports/community/php82-pecl-zstd/src/zstd-0.13.0/include -I/builds/alpine/aports/community/php82-pecl-zstd/src/zstd-0.13.0/main -I/builds/alpine/aports/community/php82-pecl-zstd/src/zstd-0.13.0 -I/usr/include/php82 -I/usr/include/php82/main -I/usr/include/php82/TSRM -I/usr/include/php82/Zend -I/usr/include/php82/ext -I/usr/include/php82/ext/date/lib -DHAVE_CONFIG_H -Os -fstack-clash-protection -Wformat -Werror=format-security -D_GNU_SOURCE -DZEND_COMPILE_DL_EXT=1 -c /builds/alpine/aports/community/php82-pecl-zstd/src/zstd-0.13.0/zstd.c -MMD -MF zstd.dep -MT zstd.lo  -fPIC -DPIC -o .libs/zstd.o
In file included from /usr/include/php82/Zend/zend_types.h:25,
                 from /usr/include/php82/Zend/zend.h:27,
                 from /usr/include/php82/main/php.h:31,
                 from /builds/alpine/aports/community/php82-pecl-zstd/src/zstd-0.13.0/zstd.c:28:
/builds/alpine/aports/community/php82-pecl-zstd/src/zstd-0.13.0/zstd.c: In function 'zif_zstd_compress':
/usr/include/php82/Zend/zend_API.h:1767:59: warning: passing argument 2 of 'zend_parse_arg_long' from incompatible pointer type [-Wincompatible-pointer-types]
 1767 |                 if (UNEXPECTED(!zend_parse_arg_long(_arg, &dest, &is_null, check_null, _i))) { \
/usr/include/php82/Zend/zend_portability.h:364:52: note: in definition of macro 'UNEXPECTED'
  364 | # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
      |                                                    ^~~~~~~~~
/usr/include/php82/Zend/zend_API.h:1774:9: note: in expansion of macro 'Z_PARAM_LONG_EX'
 1774 |         Z_PARAM_LONG_EX(dest, _dummy, 0, 0)
      |         ^~~~~~~~~~~~~~~
/builds/alpine/aports/community/php82-pecl-zstd/src/zstd-0.13.0/zstd.c:145:9: note: in expansion of macro 'Z_PARAM_LONG'
  145 |         Z_PARAM_LONG(level)
      |         ^~~~~~~~~~~~
In file included from /usr/include/php82/main/php.h:35:
/usr/include/php82/Zend/zend_API.h:2068:74: note: expected 'zend_long *' {aka 'int *'} but argument is of type 'long int *'
 2068 | static zend_always_inline bool zend_parse_arg_long(zval *arg, zend_long *dest, bool *is_null, bool check_null, uint32_t arg_num)
      |                                                               ~~~~~~~~~~~^~~~
/builds/alpine/aports/community/php82-pecl-zstd/src/zstd-0.13.0/zstd.c: In function 'zif_zstd_compress_dict':
/usr/include/php82/Zend/zend_API.h:1767:59: warning: passing argument 2 of 'zend_parse_arg_long' from incompatible pointer type [-Wincompatible-pointer-types]
 1767 |                 if (UNEXPECTED(!zend_parse_arg_long(_arg, &dest, &is_null, check_null, _i))) { \
/usr/include/php82/Zend/zend_portability.h:364:52: note: in definition of macro 'UNEXPECTED'
  364 | # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
      |                                                    ^~~~~~~~~
/usr/include/php82/Zend/zend_API.h:1774:9: note: in expansion of macro 'Z_PARAM_LONG_EX'
 1774 |         Z_PARAM_LONG_EX(dest, _dummy, 0, 0)
      |         ^~~~~~~~~~~~~~~
/builds/alpine/aports/community/php82-pecl-zstd/src/zstd-0.13.0/zstd.c:287:9: note: in expansion of macro 'Z_PARAM_LONG'
  287 |         Z_PARAM_LONG(level)
      |         ^~~~~~~~~~~~
/usr/include/php82/Zend/zend_API.h:2068:74: note: expected 'zend_long *' {aka 'int *'} but argument is of type 'long int *'
 2068 | static zend_always_inline bool zend_parse_arg_long(zval *arg, zend_long *dest, bool *is_null, bool check_null, uint32_t arg_num)
      |                                                               ~~~~~~~~~~~^~~~
/builds/alpine/aports/community/php82-pecl-zstd/src/zstd-0.13.0/zstd.c: In function 'zstd_apc_unserializer':
/builds/alpine/aports/community/php82-pecl-zstd/src/zstd-0.13.0/zstd.c:908:45: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'int' [-Wformat=]
  908 |                          "Error at offset %ld of %ld bytes",
      |                                           ~~^
      |                                             |
      |                                             long int
      |                                           %d
  909 |                          (zend_long) (tmp - (unsigned char*) var),
      |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                          |
      |                          int
/builds/alpine/aports/community/php82-pecl-zstd/src/zstd-0.13.0/zstd.c:908:52: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'int' [-Wformat=]
  908 |                          "Error at offset %ld of %ld bytes",
      |                                                  ~~^
      |                                                    |
      |                                                    long int
      |                                                  %d
  909 |                          (zend_long) (tmp - (unsigned char*) var),
  910 |                          (zend_long) var_len);
      |                          ~~~~~~~~~~~~~~~~~~~        
      |                          |
      |                          int
/bin/sh /builds/alpine/aports/community/php82-pecl-zstd/src/zstd-0.13.0/libtool --mode=link gcc -shared -I/builds/alpine/aports/community/php82-pecl-zstd/src/zstd-0.13.0/include -I/builds/alpine/aports/community/php82-pecl-zstd/src/zstd-0.13.0/main -I/builds/alpine/aports/community/php82-pecl-zstd/src/zstd-0.13.0 -I/usr/include/php82 -I/usr/include/php82/main -I/usr/include/php82/TSRM -I/usr/include/php82/Zend -I/usr/include/php82/ext -I/usr/include/php82/ext/date/lib  -DHAVE_CONFIG_H  -Os -fstack-clash-protection -Wformat -Werror=format-security -D_GNU_SOURCE  -Wl,--as-needed,-O1,--sort-common -Wl,-z,pack-relative-relocs  -o zstd.la -export-dynamic -avoid-version -prefer-pic -module -rpath /builds/alpine/aports/community/php82-pecl-zstd/src/zstd-0.13.0/modules  zstd.lo -lzstd
gcc -shared  .libs/zstd.o  -lzstd  -Wl,--as-needed -Wl,-O1 -Wl,--sort-common -Wl,-z -Wl,pack-relative-relocs -Wl,-soname -Wl,zstd.so -o .libs/zstd.so
creating zstd.la
(cd .libs && rm -f zstd.la && ln -s ../zstd.la zstd.la)
/bin/sh /builds/alpine/aports/community/php82-pecl-zstd/src/zstd-0.13.0/libtool --mode=install cp ./zstd.la /builds/alpine/aports/community/php82-pecl-zstd/src/zstd-0.13.0/modules
cp ./.libs/zstd.so /builds/alpine/aports/community/php82-pecl-zstd/src/zstd-0.13.0/modules/zstd.so
cp ./.libs/zstd.lai /builds/alpine/aports/community/php82-pecl-zstd/src/zstd-0.13.0/modules/zstd.la
PATH="$PATH:/sbin" ldconfig -n /builds/alpine/aports/community/php82-pecl-zstd/src/zstd-0.13.0/modules

refs (available 7 days)

kjdev commented 5 months ago

https://github.com/kjdev/php-ext-zstd/pull/65