-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Closed
Labels
Description
Description
While building PHP 8.4 with -std=c++17
I get:
/bin/bash /builds/psumbera/useralnd-test/components/php/php84/build/amd64/libtool --silent --preserve-dup-deps --tag=CXX --mode=compile /usr/gcc/14/bin/g++ -Iext/intl/ -I/builds/psumbera/useralnd-test/components/php/php84/php-8.4.5/ext/intl/ -I/builds/psumbera/useralnd-test/components/php/php84/build/amd64/main -I/builds/psumbera/useralnd-test/components/php/php84/build/amd64 -I/builds/psumbera/useralnd-test/components/php/php84/php-8.4.5/main -I/builds/psumbera/useralnd-test/components/php/php84/php-8.4.5 -I/builds/psumbera/useralnd-test/components/php/php84/build/amd64/ext/date/lib -I/builds/psumbera/useralnd-test/components/php/php84/php-8.4.5/ext/date/lib -I/usr/include/libxml2 -I/usr/openssl/3/include -I/usr/include/pcre -I/usr/include/idn -I/usr/include/kerberosv5 -I/usr/include/enchant -I/usr/include/glib-2.0 -I/usr/lib/amd64/glib-2.0/include -I/usr/include/gd2 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/webp -I/builds/psumbera/useralnd-test/components/php/php84/php-8.4.5/ext/mbstring/libmbfl -I/builds/psumbera/useralnd-test/components/php/php84/build/amd64/ext/mbstring/libmbfl -I/builds/psumbera/useralnd-test/components/php/php84/php-8.4.5/ext/mbstring/libmbfl/mbfl -I/builds/psumbera/useralnd-test/components/php/php84/build/amd64/ext/mbstring/libmbfl/mbfl -I/builds/psumbera/useralnd-test/components/php/php84/build/amd64/TSRM -I/builds/psumbera/useralnd-test/components/php/php84/build/amd64/Zend -I/builds/psumbera/useralnd-test/components/php/php84/php-8.4.5/Zend -I/builds/psumbera/useralnd-test/components/php/php84/php-8.4.5/TSRM -m64 -D_POSIX_PTHREAD_SEMANTICS -D_GNU_SOURCE -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -pthread -m64 -O3 -ffile-prefix-map=/builds/psumbera/useralnd-test/components/php/php84=. -pthread -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1 -DU_HIDE_OBSOLETE_UTF_OLD_H=1 -Wno-write-strings -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -std=c++17 -DUNISTR_FROM_CHAR_EXPLICIT=explicit -DUNISTR_FROM_STRING_EXPLICIT=explicit -c /builds/psumbera/useralnd-test/components/php/php84/php-8.4.5/ext/intl/common/common_enum.cpp -o ext/intl/common/common_enum.lo -MMD -MF ext/intl/common/common_enum.dep -MT ext/intl/common/common_enum.lo
In file included from /builds/psumbera/useralnd-test/components/php/php84/php-8.4.5/Zend/zend_types.h:25,
from /builds/psumbera/useralnd-test/components/php/php84/php-8.4.5/ext/intl/intl_convertcpp.h:23,
from /builds/psumbera/useralnd-test/components/php/php84/php-8.4.5/ext/intl/intl_convertcpp.cpp:17:
/builds/psumbera/useralnd-test/components/php/php84/php-8.4.5/Zend/zend_portability.h:789:49: error: expected constructor, destructor, or type conversion before '(' token
789 | # define ZEND_STATIC_ASSERT(c, m) _Static_assert((c), m)
| ^
/builds/psumbera/useralnd-test/components/php/php84/php-8.4.5/Zend/zend_compile.h:683:1: note: in expansion of macro 'ZEND_STATIC_ASSERT'
683 | ZEND_STATIC_ASSERT(ZEND_MM_ALIGNED_SIZE(sizeof(zval)) == sizeof(zval),
| ^~~~~~~~~~~~~~~~~~
/builds/psumbera/useralnd-test/components/php/php84/php-8.4.5/Zend/zend_portability.h:789:49: error: expected constructor, destructor, or type conversion before '(' token
789 | # define ZEND_STATIC_ASSERT(c, m) _Static_assert((c), m)
| ^
/builds/psumbera/useralnd-test/components/php/php84/php-8.4.5/Zend/zend_execute.h:222:1: note: in expansion of macro 'ZEND_STATIC_ASSERT'
222 | ZEND_STATIC_ASSERT(ZEND_MM_ALIGNED_SIZE(sizeof(zval)) == sizeof(zval),
| ^~~~~~~~~~~~~~~~~~
The issue can be resolved with:
--- php-8.4.5/Zend/zend_portability.h
+++ php-8.4.5/Zend/zend_portability.h
@@ -785,7 +785,9 @@
/** @deprecated */
#define ZEND_CGG_DIAGNOSTIC_IGNORED_END ZEND_DIAGNOSTIC_IGNORED_END
-#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* C11 */
+#if defined(__cplusplus)
+# define ZEND_STATIC_ASSERT(c, m) static_assert((c), m)
+#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* C11 */
# define ZEND_STATIC_ASSERT(c, m) _Static_assert((c), m)
#else
# define ZEND_STATIC_ASSERT(c, m)
PHP Version
PHP 8.4.5 (but the same code is with 8.4.10).
Operating System
Solaris 11.4