Skip to content

Commit 9e226b2

Browse files
committed
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.
1 parent 184ffe2 commit 9e226b2

File tree

2 files changed

+18
-27
lines changed

2 files changed

+18
-27
lines changed

NEWS

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? ????, PHP 8.2.21
44

5+
- Core:
6+
. Fixed bug GH-14315 (Incompatible pointer type warnings). (Peter Kokot)
7+
58
- Curl:
69
. Fixed bug GH-14307 (Test curl_basic_024 fails with curl 8.8.0). (nielsdos)
710

build/php.m4

+15-27
Original file line numberDiff line numberDiff line change
@@ -1260,33 +1260,21 @@ dnl
12601260
dnl PHP_MISSING_TIME_R_DECL
12611261
dnl
12621262
AC_DEFUN([PHP_MISSING_TIME_R_DECL],[
1263-
AC_MSG_CHECKING([for missing declarations of reentrant functions])
1264-
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[struct tm *(*func)(void) = localtime_r]])],[
1265-
:
1266-
],[
1267-
AC_DEFINE(MISSING_LOCALTIME_R_DECL,1,[Whether localtime_r is declared])
1268-
])
1269-
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[struct tm *(*func)(void) = gmtime_r]])],[
1270-
:
1271-
],[
1272-
AC_DEFINE(MISSING_GMTIME_R_DECL,1,[Whether gmtime_r is declared])
1273-
])
1274-
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[char *(*func)(void) = asctime_r]])],[
1275-
:
1276-
],[
1277-
AC_DEFINE(MISSING_ASCTIME_R_DECL,1,[Whether asctime_r is declared])
1278-
])
1279-
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[char *(*func)(void) = ctime_r]])],[
1280-
:
1281-
],[
1282-
AC_DEFINE(MISSING_CTIME_R_DECL,1,[Whether ctime_r is declared])
1283-
])
1284-
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <string.h>]], [[char *(*func)(void) = strtok_r]])],[
1285-
:
1286-
],[
1287-
AC_DEFINE(MISSING_STRTOK_R_DECL,1,[Whether strtok_r is declared])
1288-
])
1289-
AC_MSG_RESULT([done])
1263+
AC_CHECK_DECL([localtime_r],,
1264+
[AC_DEFINE([MISSING_LOCALTIME_R_DECL], [1], [Whether localtime_r is declared])],
1265+
[#include <time.h>])
1266+
AC_CHECK_DECL([gmtime_r],,
1267+
[AC_DEFINE([MISSING_GMTIME_R_DECL], [1], [Whether gmtime_r is declared])],
1268+
[#include <time.h>])
1269+
AC_CHECK_DECL([asctime_r],,
1270+
[AC_DEFINE([MISSING_ASCTIME_R_DECL], [1], [Whether asctime_r is declared])],
1271+
[#include <time.h>])
1272+
AC_CHECK_DECL([ctime_r],,
1273+
[AC_DEFINE([MISSING_CTIME_R_DECL], [1], [Whether ctime_r is declared])],
1274+
[#include <time.h>])
1275+
AC_CHECK_DECL([strtok_r],,
1276+
[AC_DEFINE([MISSING_STRTOK_R_DECL], [1], [Whether strtok_r is declared])],
1277+
[#include <string.h>])
12901278
])
12911279

12921280
dnl

0 commit comments

Comments
 (0)