From 9e226b288106aea3bfb71bae707a3e2d4889e82d Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Fri, 24 May 2024 20:57:52 +0200 Subject: [PATCH] Fix incompatible pointer type warnings This fixes the incompatible pointer type warnings when checking for reentrant functions declaractions (-Wincompatible-pointer-types) in config.log. These were not declared on some obsolete systems if _REENTRANT was not defined. The check is for now left in the code base but can be transitioned to newer code without checking for missing declarations or using these otherwise in the future. Closes GH-14315. --- NEWS | 3 +++ build/php.m4 | 42 +++++++++++++++--------------------------- 2 files changed, 18 insertions(+), 27 deletions(-) diff --git a/NEWS b/NEWS index ace73347396..6cec84d3df6 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,9 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, PHP 8.2.21 +- Core: + . Fixed bug GH-14315 (Incompatible pointer type warnings). (Peter Kokot) + - Curl: . Fixed bug GH-14307 (Test curl_basic_024 fails with curl 8.8.0). (nielsdos) diff --git a/build/php.m4 b/build/php.m4 index 8ce9656ad1d..03716cf7f9d 100644 --- a/build/php.m4 +++ b/build/php.m4 @@ -1260,33 +1260,21 @@ dnl dnl PHP_MISSING_TIME_R_DECL dnl AC_DEFUN([PHP_MISSING_TIME_R_DECL],[ - AC_MSG_CHECKING([for missing declarations of reentrant functions]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[struct tm *(*func)(void) = localtime_r]])],[ - : - ],[ - AC_DEFINE(MISSING_LOCALTIME_R_DECL,1,[Whether localtime_r is declared]) - ]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[struct tm *(*func)(void) = gmtime_r]])],[ - : - ],[ - AC_DEFINE(MISSING_GMTIME_R_DECL,1,[Whether gmtime_r is declared]) - ]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[char *(*func)(void) = asctime_r]])],[ - : - ],[ - AC_DEFINE(MISSING_ASCTIME_R_DECL,1,[Whether asctime_r is declared]) - ]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[char *(*func)(void) = ctime_r]])],[ - : - ],[ - AC_DEFINE(MISSING_CTIME_R_DECL,1,[Whether ctime_r is declared]) - ]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[char *(*func)(void) = strtok_r]])],[ - : - ],[ - AC_DEFINE(MISSING_STRTOK_R_DECL,1,[Whether strtok_r is declared]) - ]) - AC_MSG_RESULT([done]) +AC_CHECK_DECL([localtime_r],, + [AC_DEFINE([MISSING_LOCALTIME_R_DECL], [1], [Whether localtime_r is declared])], + [#include ]) +AC_CHECK_DECL([gmtime_r],, + [AC_DEFINE([MISSING_GMTIME_R_DECL], [1], [Whether gmtime_r is declared])], + [#include ]) +AC_CHECK_DECL([asctime_r],, + [AC_DEFINE([MISSING_ASCTIME_R_DECL], [1], [Whether asctime_r is declared])], + [#include ]) +AC_CHECK_DECL([ctime_r],, + [AC_DEFINE([MISSING_CTIME_R_DECL], [1], [Whether ctime_r is declared])], + [#include ]) +AC_CHECK_DECL([strtok_r],, + [AC_DEFINE([MISSING_STRTOK_R_DECL], [1], [Whether strtok_r is declared])], + [#include ]) ]) dnl