From 0e0067c9056224a781b18d68a91eaba83e8ce35d Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 6 May 2020 09:23:01 +0200 Subject: test build for https://github.com/phpredis/phpredis/pull/1750 --- 1750.patch | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++ php-pecl-redis5.spec | 9 +++++++- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 1750.patch diff --git a/1750.patch b/1750.patch new file mode 100644 index 0000000..4c3642e --- /dev/null +++ b/1750.patch @@ -0,0 +1,59 @@ +From 2d19ba1d6fe8f0f650d7b9bc02c5f1cb10dbb9e0 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Wed, 6 May 2020 08:54:43 +0200 +Subject: [PATCH] fix [-Wformat=] warning on 32-bit + +--- + cluster_library.c | 2 +- + redis_array.c | 4 ++-- + redis_cluster.c | 2 +- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/cluster_library.c b/cluster_library.c +index 191947c57..b21a68758 100644 +--- a/cluster_library.c ++++ b/cluster_library.c +@@ -552,7 +552,7 @@ unsigned short cluster_hash_key_zval(zval *z_key) { + klen = Z_STRLEN_P(z_key); + break; + case IS_LONG: +- klen = snprintf(buf,sizeof(buf),"%ld",Z_LVAL_P(z_key)); ++ klen = snprintf(buf,sizeof(buf),ZEND_LONG_FMT,Z_LVAL_P(z_key)); + kptr = (const char *)buf; + break; + case IS_DOUBLE: +diff --git a/redis_array.c b/redis_array.c +index 7f8fa129d..bdd7120ef 100644 +--- a/redis_array.c ++++ b/redis_array.c +@@ -926,7 +926,7 @@ PHP_METHOD(RedisArray, mget) + key_len = Z_STRLEN_P(data); + key_lookup = Z_STRVAL_P(data); + } else { +- key_len = snprintf(kbuf, sizeof(kbuf), "%ld", Z_LVAL_P(data)); ++ key_len = snprintf(kbuf, sizeof(kbuf), ZEND_LONG_FMT, Z_LVAL_P(data)); + key_lookup = (char*)kbuf; + } + +@@ -1052,7 +1052,7 @@ PHP_METHOD(RedisArray, mset) + key_len = ZSTR_LEN(zkey); + key = ZSTR_VAL(zkey); + } else { +- key_len = snprintf(kbuf, sizeof(kbuf), "%lu", idx); ++ key_len = snprintf(kbuf, sizeof(kbuf), ZEND_ULONG_FMT, idx); + key = kbuf; + } + +diff --git a/redis_cluster.c b/redis_cluster.c +index ee218ba05..7f79b5fe8 100644 +--- a/redis_cluster.c ++++ b/redis_cluster.c +@@ -2245,7 +2245,7 @@ cluster_cmd_get_slot(redisCluster *c, zval *z_arg) + + /* Inform the caller if they've passed bad data */ + if (slot < 0) { +- php_error_docref(0, E_WARNING, "Unknown node %s:%ld", ++ php_error_docref(0, E_WARNING, "Unknown node %s:" ZEND_LONG_FMT, + Z_STRVAL_P(z_host), Z_LVAL_P(z_port)); + } + } else { diff --git a/php-pecl-redis5.spec b/php-pecl-redis5.spec index 68e98f6..848f2de 100644 --- a/php-pecl-redis5.spec +++ b/php-pecl-redis5.spec @@ -30,11 +30,13 @@ Summary: Extension for communicating with the Redis key-value store Name: %{?sub_prefix}php-pecl-redis5 Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}} -Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz License: PHP URL: https://pecl.php.net/package/redis +Patch0: https://patch-diff.githubusercontent.com/raw/phpredis/phpredis/pull/1750.patch + BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel > 7 BuildRequires: %{?scl_prefix}php-pear @@ -128,6 +130,8 @@ sed -e 's/role="test"/role="src"/' \ -i package.xml cd NTS +%patch0 -p1 + # Use system library rm -r liblzf @@ -342,6 +346,9 @@ fi %changelog +* Wed May 6 2020 Remi Collet - 5.2.2-2 +- test build for https://github.com/phpredis/phpredis/pull/1750 + * Wed May 6 2020 Remi Collet - 5.2.2-1 - update to 5.2.2 -- cgit