Fix: error: incompatible function pointer types initializing 'struct tm *(*)(void)' with an expression of type 'struct tm *(const time_t *restrict, struct tm *restrict)' (aka 'struct tm *(const long *restrict, struct tm *restrict)') [-Werror,-Wincompatible-function-pointer-types] error: incompatible function pointer types initializing 'struct tm *(*)(void)' with an expression of type 'struct tm *(const time_t *restrict, struct tm *restrict)' (aka 'struct tm *(const long *restrict, struct tm *restrict)') [-Werror,-Wincompatible-function-pointer-types] error: incompatible function pointer types initializing 'char *(*)(void)' with an expression of type 'char *(const struct tm *restrict, char *restrict)' [-Werror,-Wincompatible-function-pointer-types] error: incompatible function pointer types initializing 'char *(*)(void)' with an expression of type 'char *(const time_t *, char *)' (aka 'char *(const long *, char *)') [-Werror,-Wincompatible-function-pointer-types] error: incompatible function pointer types initializing 'char *(*)(void)' with an expression of type 'char *(char *, const char *, char **)' [-Werror,-Wincompatible-function-pointer-types] https://github.com/php/php-src/issues/14315 https://github.com/php/php-src/commit/9e226b288106aea3bfb71bae707a3e2d4889e82d error: incompatible function pointer types initializing 'int (*)(void)' with an expression of type 'int (FILE *)' (aka 'int (struct __sFILE *)') [-Werror,-Wincompatible-function-pointer-types] https://github.com/php/php-src/issues/14549 https://github.com/php/php-src/commit/b43378d830872acc6c8515e2815c9f98c7787e62 --- a/build/php.m4 2024-06-04 09:53:17.000000000 -0500 +++ b/build/php.m4 2024-06-13 04:35:51.000000000 -0500 @@ -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 @@ -1315,7 +1315,7 @@ dnl AC_DEFUN([PHP_MISSING_FCLOSE_DECL],[ AC_MSG_CHECKING([for fclose declaration]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[int (*func)(void) = fclose]])],[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[int (*func)(FILE *) = fclose]])],[ AC_DEFINE(MISSING_FCLOSE_DECL,0,[ ]) AC_MSG_RESULT([ok]) ],[