testing/php81-pecl-yaml: add patch for gcc14

This commit is contained in:
Andy Postnikov 2024-08-30 23:07:02 +02:00
parent 8db24d0e55
commit b9c92f6348
2 changed files with 107 additions and 2 deletions

View file

@ -3,7 +3,7 @@
pkgname=php81-pecl-yaml
_extname=yaml
pkgver=2.2.3
pkgrel=1
pkgrel=2
pkgdesc="YAML syntax bindings for PHP 8.1 - PECL"
url="https://pecl.php.net/package/yaml"
arch="all"
@ -12,7 +12,8 @@ _phpv=81
_php=php$_phpv
depends="$_php-common"
makedepends="$_php-dev yaml-dev"
source="php-pecl-$_extname-$pkgver.tgz::https://pecl.php.net/get/$_extname-$pkgver.tgz"
source="php-pecl-$_extname-$pkgver.tgz::https://pecl.php.net/get/$_extname-$pkgver.tgz
php-yaml-fix-gcc14.patch"
builddir="$srcdir/$_extname-$pkgver"
install_if="php-$_extname php$_phpv"
@ -37,4 +38,5 @@ package() {
sha512sums="
99d63d430dd2fa9767ecb3f70599d2ebd4c53b27770df72c00c4723816de422c581cea05e96c3cba5aaecbdc57cc482fad0f1fa300bdcf887daa7c2c034e6f4b php-pecl-yaml-2.2.3.tgz
4812f3a8befd3ae5718690ea370f80962140f43ef28c32026d597f57f5264c0de7dae7ba19c3947fc0d9fce46b1cc035fd04c21369e37fb8dfd5c130b194d7f6 php-yaml-fix-gcc14.patch
"

View file

@ -0,0 +1,103 @@
Patch-Source: https://github.com/php/pecl-file_formats-yaml/commit/e7bffc01c496ef36ce672c612984b13a27426788
From e7bffc01c496ef36ce672c612984b13a27426788 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Mon, 6 Mar 2023 09:29:07 +0100
Subject: [PATCH] Fix [-Wincompatible-pointer-types] warning
---
parse.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/parse.c b/parse.c
index e63f3d8..17f70ba 100644
--- a/parse.c
+++ b/parse.c
@@ -531,7 +531,7 @@ void handle_sequence (parser_state_t *state, zval *retval) {
/* apply callbacks to the collected node */
if (Y_FILTER_FAILURE == apply_filter(
retval, src_event, state->callbacks)) {
- zval_ptr_dtor(&retval);
+ zval_ptr_dtor(retval);
ZVAL_UNDEF(retval);
goto done;
//TODO Sean-Der
Patch-Source: https://github.com/php/pecl-file_formats-yaml/commit/730a781f7773f752efb17d88737d5ba5b043fa87
From 730a781f7773f752efb17d88737d5ba5b043fa87 Mon Sep 17 00:00:00 2001
From: Tom Regner <tom@goochesa.de>
Date: Thu, 9 Mar 2023 14:03:56 +0100
Subject: [PATCH] Fix #75: Handle zndocs/ndocs correctly
Just changing the handling, that is param handling of ndocs and dtor call for zndocs, in yaml_parse_file to that in yaml_parse.
That fixes #75 for me.
---
yaml.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/yaml.c b/yaml.c
index 4ca2cfe..d157a5b 100644
--- a/yaml.c
+++ b/yaml.c
@@ -407,7 +407,7 @@ PHP_FUNCTION(yaml_parse_file)
YAML_G(timestamp_decoder) = NULL;
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(),
- "s|lza/", &filename, &filename_len, &pos, &zndocs,
+ "s|lz/a/", &filename, &filename_len, &pos, &zndocs,
&zcallbacks)) {
return;
}
@@ -451,7 +451,7 @@ PHP_FUNCTION(yaml_parse_file)
if (zndocs != NULL) {
/* copy document count to var user sent in */
- zval_dtor(zndocs);
+ zval_ptr_dtor(zndocs);
ZVAL_LONG(zndocs, ndocs);
}
Patch-Source: https://github.com/php/pecl-file_formats-yaml/commit/09bc7fd194cca241d5ce9daef56ee4e51d4e6ed9
From 09bc7fd194cca241d5ce9daef56ee4e51d4e6ed9 Mon Sep 17 00:00:00 2001
From: Bryan Davis <bd808@bd808.com>
Date: Tue, 28 Mar 2023 13:42:51 -0600
Subject: [PATCH] yaml.c: Use PHP_FE_END macro
---
yaml.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/yaml.c b/yaml.c
index d157a5b..a91d4f1 100644
--- a/yaml.c
+++ b/yaml.c
@@ -133,7 +133,7 @@ static zend_function_entry yaml_functions[] = {
PHP_FE(yaml_parse_url, arginfo_yaml_parse_url)
PHP_FE(yaml_emit, arginfo_yaml_emit)
PHP_FE(yaml_emit_file, arginfo_yaml_emit_file)
- {NULL, NULL, NULL}
+ PHP_FE_END
};
/* }}} */
From fe099012e1526abc6eb22c30d5b5340748ab9545 Mon Sep 17 00:00:00 2001
From: Bryan Davis <bd808@bd808.com>
Date: Tue, 28 Mar 2023 14:48:04 -0600
Subject: [PATCH] emit.c: fix -Wsign-compare
Use size_t for strlen to avoid sign-compare warning.
---
emit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/emit.c b/emit.c
index b93db5a..ab7e46c 100644
--- a/emit.c
+++ b/emit.c
@@ -433,7 +433,7 @@ static int y_write_string(
size_t pos = 0, us;
int j;
const unsigned char *s = (const unsigned char *)Z_STRVAL_P(data);
- int len = Z_STRLEN_P(data);
+ size_t len = Z_STRLEN_P(data);
for (j = 0; pos < len; j++) {
us = get_next_char(s, len, &pos, &status);