Skip to content

Commit f702437

Browse files
committed
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Append -Wno-implicit-fallthrough flag conditionally (#13331)
2 parents c26d1a3 + d20d113 commit f702437

File tree

5 files changed

+24
-4
lines changed

5 files changed

+24
-4
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ PHP NEWS
66
. Fixed bug GH-15020 (Memory leak in Zend/Optimizer/escape_analysis.c).
77
(nielsdos)
88
. Fixed bug GH-15023 (Memory leak in Zend/zend_ini.c). (nielsdos)
9+
. Fixed bug GH-13330 (Append -Wno-implicit-fallthrough flag conditionally).
10+
(Peter Kokot)
911

1012
- Curl:
1113
. Fixed case when curl_error returns an empty string.

ext/date/config0.m4

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ AC_CHECK_HEADERS([io.h])
44
dnl Check for strtoll, atoll
55
AC_CHECK_FUNCS(strtoll atoll)
66

7-
PHP_DATE_CFLAGS="-Wno-implicit-fallthrough -I@ext_builddir@/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1"
7+
AX_CHECK_COMPILE_FLAG([-Wno-implicit-fallthrough],
8+
[PHP_DATE_CFLAGS="$PHP_DATE_CFLAGS -Wno-implicit-fallthrough"],,
9+
[-Werror])
10+
11+
PHP_DATE_CFLAGS="$PHP_DATE_CFLAGS -I@ext_builddir@/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1"
812
timelib_sources="lib/astro.c lib/dow.c lib/parse_date.c lib/parse_tz.c lib/parse_posix.c
913
lib/timelib.c lib/tm2unixtime.c lib/unixtime2tm.c lib/parse_iso_intervals.c lib/interval.c"
1014

ext/hash/config.m4

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,13 @@ else
2424
SHA3_OPT_SRC="$SHA3_DIR/KeccakP-1600-opt64.c"
2525
])
2626
EXT_HASH_SHA3_SOURCES="$SHA3_OPT_SRC $SHA3_DIR/KeccakHash.c $SHA3_DIR/KeccakSponge.c hash_sha3.c"
27+
2728
dnl Add -Wno-implicit-fallthrough flag as it happens on 32 bit builds
28-
PHP_HASH_CFLAGS="-Wno-implicit-fallthrough -I@ext_srcdir@/$SHA3_DIR -DKeccakP200_excluded -DKeccakP400_excluded -DKeccakP800_excluded -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
29+
AX_CHECK_COMPILE_FLAG([-Wno-implicit-fallthrough],
30+
[PHP_HASH_CFLAGS="$PHP_HASH_CFLAGS -Wno-implicit-fallthrough"],,
31+
[-Werror])
32+
33+
PHP_HASH_CFLAGS="$PHP_HASH_CFLAGS -I@ext_srcdir@/$SHA3_DIR -DKeccakP200_excluded -DKeccakP400_excluded -DKeccakP800_excluded -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
2934

3035
PHP_ADD_BUILD_DIR(ext/hash/$SHA3_DIR, 1)
3136
fi

ext/opcache/config.m4

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,10 @@ int main(void) {
300300
fi
301301
AC_MSG_RESULT([$have_shm_mmap_posix])
302302

303+
AX_CHECK_COMPILE_FLAG([-Wno-implicit-fallthrough],
304+
[PHP_OPCACHE_CFLAGS="$PHP_OPCACHE_CFLAGS -Wno-implicit-fallthrough"],,
305+
[-Werror])
306+
303307
PHP_NEW_EXTENSION(opcache,
304308
ZendAccelerator.c \
305309
zend_accelerator_blacklist.c \
@@ -315,7 +319,7 @@ int main(void) {
315319
shared_alloc_mmap.c \
316320
shared_alloc_posix.c \
317321
$ZEND_JIT_SRC,
318-
shared,,"-Wno-implicit-fallthrough -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1",,yes)
322+
shared,,"$PHP_OPCACHE_CFLAGS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1",,yes)
319323

320324
PHP_ADD_EXTENSION_DEP(opcache, pcre)
321325

ext/pcre/config0.m4

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,12 @@ else
6666
pcre2lib/pcre2_string_utils.c pcre2lib/pcre2_study.c pcre2lib/pcre2_substitute.c pcre2lib/pcre2_substring.c \
6767
pcre2lib/pcre2_tables.c pcre2lib/pcre2_ucd.c pcre2lib/pcre2_valid_utf.c pcre2lib/pcre2_xclass.c \
6868
pcre2lib/pcre2_find_bracket.c pcre2lib/pcre2_convert.c pcre2lib/pcre2_extuni.c pcre2lib/pcre2_script_run.c"
69-
PHP_PCRE_CFLAGS="-Wno-implicit-fallthrough -DHAVE_CONFIG_H -I@ext_srcdir@/pcre2lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
69+
70+
AX_CHECK_COMPILE_FLAG([-Wno-implicit-fallthrough],
71+
[PHP_PCRE_CFLAGS="$PHP_PCRE_CFLAGS -Wno-implicit-fallthrough"],,
72+
[-Werror])
73+
74+
PHP_PCRE_CFLAGS="$PHP_PCRE_CFLAGS -DHAVE_CONFIG_H -I@ext_srcdir@/pcre2lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
7075
AC_DEFINE(HAVE_BUNDLED_PCRE, 1, [ ])
7176
AC_DEFINE(PCRE2_CODE_UNIT_WIDTH, 8, [ ])
7277

0 commit comments

Comments
 (0)