Skip to content

Remove conditional checks for ssize_t type #18996

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions UPGRADING.INTERNALS
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,14 @@ PHP 8.5 INTERNALS UPGRADE NOTES
. Autoconf macro PHP_AP_EXTRACT_VERSION has been removed.
. Autoconf macro PHP_BUILD_THREAD_SAFE has been removed (set enable_zts
manually).
. Autoconf macro PHP_CHECK_SIZEOF is obsolete (use AC_CHECK_SIZEOF).
. Autoconf macro PHP_DEF_HAVE has been removed (use AC_DEFINE).
. Autoconf macro PHP_OUTPUT has been removed (use AC_CONFIG_FILES).
. Autoconf macro PHP_TEST_BUILD has been removed (use AC_* macros).
. Preprocessor macro HAVE_PTRDIFF_T has been removed.
. Preprocessor macro HAVE_INTMAX_T has been removed.
. Preprocessor macro HAVE_SSIZE_T has been removed.
. Preprocessor macro SIZEOF_SSIZE_T has been removed.

========================
3. Module changes
Expand Down
7 changes: 6 additions & 1 deletion build/php.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,9 @@ dnl _PHP_CHECK_SIZEOF(type, cross-value, extra-headers [, found-action [, not-fo
dnl
dnl Internal helper macro.
dnl
AC_DEFUN([_PHP_CHECK_SIZEOF], [
AC_DEFUN([_PHP_CHECK_SIZEOF],
[m4_warn([obsolete],
[The PHP_CHECK_SIZEOF macro is obsolete. Use AC_CHECK_SIZEOF.])
php_cache_value=php_cv_sizeof_[]$1
AC_CACHE_VAL(php_cv_sizeof_[]$1, [
old_LIBS=$LIBS
Expand Down Expand Up @@ -1056,6 +1058,9 @@ ifelse([$5],[],,[else $5])
dnl
dnl PHP_CHECK_SIZEOF(type, cross-value, extra-headers)
dnl
dnl Checks the size of specified "type". This macro is obsolete as of PHP 8.5 in
dnl favor of the AC_CHECK_SIZEOF.
dnl
AC_DEFUN([PHP_CHECK_SIZEOF], [
AC_MSG_CHECKING([size of $1])
_PHP_CHECK_SIZEOF($1, $2, $3, [
Expand Down
3 changes: 0 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -451,9 +451,6 @@ AC_CHECK_TYPES([socklen_t], [], [], [
#endif
])

dnl These are defined elsewhere than stdio.h.
PHP_CHECK_SIZEOF([ssize_t], [8])

dnl Check stdint types (must be after header check).
PHP_CHECK_STDINT_TYPES

Expand Down
4 changes: 0 additions & 4 deletions main/snprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,11 +709,7 @@ static size_t format_converter(buffy * odp, const char *fmt, va_list ap) /* {{{
i_num = (int64_t) va_arg(ap, long int);
break;
case LM_SIZE_T:
#if SIZEOF_SSIZE_T
i_num = (int64_t) va_arg(ap, ssize_t);
#else
i_num = (int64_t) va_arg(ap, size_t);
#endif
break;
#if SIZEOF_LONG_LONG
case LM_LONG_LONG:
Expand Down
4 changes: 0 additions & 4 deletions main/spprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,11 +418,7 @@ static void xbuf_format_converter(void *xbuf, bool is_char, const char *fmt, va_
i_num = (int64_t) va_arg(ap, long int);
break;
case LM_SIZE_T:
#if SIZEOF_SSIZE_T
i_num = (int64_t) va_arg(ap, ssize_t);
#else
i_num = (int64_t) va_arg(ap, size_t);
#endif
break;
#if SIZEOF_LONG_LONG
case LM_LONG_LONG:
Expand Down