Skip to content

Commit 61caa60

Browse files
committed
Fix PHP-8.4-dev typedef redefinition warnings
This fixes warnings that fill up the build log due to different compilation flags used and clang. See: php/php-src#13199
1 parent 8a7c49f commit 61caa60

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

bin/make-patches.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ patch-cmake-8.4
2626
patch-cmake-8.4-dmalloc
2727
patch-cmake-8.4-docs
2828
patch-cmake-8.4-phpdbg-local-console
29+
patch-cmake-8.4-typedef-warnings
2930
"
3031
php_versions="8.3 8.4"
3132

patches/8.4/typedef-warnings.patch

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
diff --git a/Zend/zend_frameless_function.h b/Zend/zend_frameless_function.h
2+
index 6821654bc4..94e9812ed9 100644
3+
--- a/Zend/zend_frameless_function.h
4+
+++ b/Zend/zend_frameless_function.h
5+
@@ -26,7 +26,7 @@
6+
# include <php_config.h>
7+
#endif
8+
9+
-#include "zend_portability.h"
10+
+#include "zend_types.h"
11+
12+
#define ZEND_FRAMELESS_FUNCTION_PARAMETERS_0 zval *return_value
13+
#define ZEND_FRAMELESS_FUNCTION_PARAMETERS_1 zval *return_value, zval *arg1
14+
@@ -103,10 +103,6 @@
15+
16+
BEGIN_EXTERN_C()
17+
18+
-typedef struct _zval_struct zval;
19+
-typedef struct _zend_op zend_op;
20+
-typedef union _zend_function zend_function;
21+
-
22+
typedef void (*zend_frameless_function_0)(zval *return_value);
23+
typedef void (*zend_frameless_function_1)(zval *return_value, zval *op1);
24+
typedef void (*zend_frameless_function_2)(zval *return_value, zval *op1, zval *op2);

patches/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ CMake.
2121

2222
See https://github.com/php/php-src/pull/13199
2323

24+
* `typedef-warnings.patch`
25+
26+
This fixes many warnings in the build to make the build experience friendlier
27+
due to various compilation flags used in some cases. It was decided to not
28+
port upstream but is kept here until C11 is the standard used in PHP:
29+
https://github.com/php/php-src/pull/13347
30+
2431
## PHP 8.3
2532

2633
* `cmake.patch`

0 commit comments

Comments
 (0)