From 77118fc925b3e84be02a80d8da6bbbb47f8c37e1 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Wed, 5 Sep 2018 00:09:56 +0200 Subject: [PATCH] Remove HAVE_ASSERT_H The `` header file is part of the standard C89 headers [1] and on older systems there needed to be also a manual check if header is present. Since PHP requires at least C89 manual check and the `HAVE_ASSERT_H` symbol defined by Autoconf in configure.ac can be both removed [2]. This patch also removes unused includes where c files don't use the `assert()` macro. Refs: [1] https://port70.net/~nsz/c/c89/c89-draft.html#4.2 [2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4 --- configure.ac | 2 -- ext/bcmath/libbcmath/src/add.c | 1 - ext/bcmath/libbcmath/src/compare.c | 1 - ext/bcmath/libbcmath/src/debug.c | 1 - ext/bcmath/libbcmath/src/div.c | 1 - ext/bcmath/libbcmath/src/divmod.c | 1 - ext/bcmath/libbcmath/src/doaddsub.c | 1 - ext/bcmath/libbcmath/src/init.c | 1 - ext/bcmath/libbcmath/src/int2num.c | 1 - ext/bcmath/libbcmath/src/nearzero.c | 1 - ext/bcmath/libbcmath/src/neg.c | 1 - ext/bcmath/libbcmath/src/num2long.c | 1 - ext/bcmath/libbcmath/src/num2str.c | 1 - ext/bcmath/libbcmath/src/outofmem.c | 1 - ext/bcmath/libbcmath/src/output.c | 1 - ext/bcmath/libbcmath/src/raise.c | 1 - ext/bcmath/libbcmath/src/raisemod.c | 1 - ext/bcmath/libbcmath/src/rmzero.c | 1 - ext/bcmath/libbcmath/src/sqrt.c | 1 - ext/bcmath/libbcmath/src/str2num.c | 1 - ext/bcmath/libbcmath/src/sub.c | 1 - ext/bcmath/libbcmath/src/zero.c | 1 - ext/mbstring/libmbfl/config.h.in | 3 --- ext/mbstring/libmbfl/config.h.w32 | 1 - ext/standard/strnatcmp.c | 1 - main/php.h | 4 ---- main/php_syslog.c | 1 - win32/build/config.w32.h.in | 1 - 28 files changed, 34 deletions(-) diff --git a/configure.ac b/configure.ac index 2ad2190275..aa5456e8c5 100644 --- a/configure.ac +++ b/configure.ac @@ -434,7 +434,6 @@ netinet/in.h \ alloca.h \ arpa/inet.h \ arpa/nameser.h \ -assert.h \ crypt.h \ dns.h \ fcntl.h \ @@ -477,7 +476,6 @@ utime.h \ sys/utsname.h \ sys/ipc.h \ dlfcn.h \ -assert.h \ tmmintrin.h \ nmmintrin.h \ immintrin.h diff --git a/ext/bcmath/libbcmath/src/add.c b/ext/bcmath/libbcmath/src/add.c index ade5b5969a..d41ea01914 100644 --- a/ext/bcmath/libbcmath/src/add.c +++ b/ext/bcmath/libbcmath/src/add.c @@ -31,7 +31,6 @@ #include #include -#include #include #include #include diff --git a/ext/bcmath/libbcmath/src/compare.c b/ext/bcmath/libbcmath/src/compare.c index 6217ef1af3..ced7ec1916 100644 --- a/ext/bcmath/libbcmath/src/compare.c +++ b/ext/bcmath/libbcmath/src/compare.c @@ -31,7 +31,6 @@ #include #include -#include #include #include #include diff --git a/ext/bcmath/libbcmath/src/debug.c b/ext/bcmath/libbcmath/src/debug.c index 0ff7d652cd..b711c06143 100644 --- a/ext/bcmath/libbcmath/src/debug.c +++ b/ext/bcmath/libbcmath/src/debug.c @@ -31,7 +31,6 @@ #include #include -#include #include #include #include diff --git a/ext/bcmath/libbcmath/src/div.c b/ext/bcmath/libbcmath/src/div.c index df5de29919..a8039f2b76 100644 --- a/ext/bcmath/libbcmath/src/div.c +++ b/ext/bcmath/libbcmath/src/div.c @@ -31,7 +31,6 @@ #include #include -#include #include #include #include diff --git a/ext/bcmath/libbcmath/src/divmod.c b/ext/bcmath/libbcmath/src/divmod.c index 08c2f8a2a2..6ee6c255cb 100644 --- a/ext/bcmath/libbcmath/src/divmod.c +++ b/ext/bcmath/libbcmath/src/divmod.c @@ -31,7 +31,6 @@ #include #include -#include #include #include #include diff --git a/ext/bcmath/libbcmath/src/doaddsub.c b/ext/bcmath/libbcmath/src/doaddsub.c index cef0fdbf1b..dc0ba0614b 100644 --- a/ext/bcmath/libbcmath/src/doaddsub.c +++ b/ext/bcmath/libbcmath/src/doaddsub.c @@ -31,7 +31,6 @@ #include #include -#include #include #include #include diff --git a/ext/bcmath/libbcmath/src/init.c b/ext/bcmath/libbcmath/src/init.c index bd73da2a9d..227a34fadf 100644 --- a/ext/bcmath/libbcmath/src/init.c +++ b/ext/bcmath/libbcmath/src/init.c @@ -31,7 +31,6 @@ #include #include -#include #include #include #include diff --git a/ext/bcmath/libbcmath/src/int2num.c b/ext/bcmath/libbcmath/src/int2num.c index a8965f6040..12a3342c39 100644 --- a/ext/bcmath/libbcmath/src/int2num.c +++ b/ext/bcmath/libbcmath/src/int2num.c @@ -31,7 +31,6 @@ #include #include -#include #include #include #include diff --git a/ext/bcmath/libbcmath/src/nearzero.c b/ext/bcmath/libbcmath/src/nearzero.c index 1f2f0708cc..041c7e149d 100644 --- a/ext/bcmath/libbcmath/src/nearzero.c +++ b/ext/bcmath/libbcmath/src/nearzero.c @@ -31,7 +31,6 @@ #include #include -#include #include #include #include diff --git a/ext/bcmath/libbcmath/src/neg.c b/ext/bcmath/libbcmath/src/neg.c index 619a59bb05..8c00905598 100644 --- a/ext/bcmath/libbcmath/src/neg.c +++ b/ext/bcmath/libbcmath/src/neg.c @@ -31,7 +31,6 @@ #include #include -#include #include #include #include diff --git a/ext/bcmath/libbcmath/src/num2long.c b/ext/bcmath/libbcmath/src/num2long.c index be84986d23..2cef6791c4 100644 --- a/ext/bcmath/libbcmath/src/num2long.c +++ b/ext/bcmath/libbcmath/src/num2long.c @@ -31,7 +31,6 @@ #include #include -#include #include #include #include diff --git a/ext/bcmath/libbcmath/src/num2str.c b/ext/bcmath/libbcmath/src/num2str.c index 7316d32a14..742d3278e7 100644 --- a/ext/bcmath/libbcmath/src/num2str.c +++ b/ext/bcmath/libbcmath/src/num2str.c @@ -31,7 +31,6 @@ #include #include -#include #include #include #include diff --git a/ext/bcmath/libbcmath/src/outofmem.c b/ext/bcmath/libbcmath/src/outofmem.c index 7c67509686..e1e3f5317f 100644 --- a/ext/bcmath/libbcmath/src/outofmem.c +++ b/ext/bcmath/libbcmath/src/outofmem.c @@ -31,7 +31,6 @@ #include #include -#include #include #include #include diff --git a/ext/bcmath/libbcmath/src/output.c b/ext/bcmath/libbcmath/src/output.c index 9fbca0f4c4..e172662002 100644 --- a/ext/bcmath/libbcmath/src/output.c +++ b/ext/bcmath/libbcmath/src/output.c @@ -31,7 +31,6 @@ #include #include -#include #include #include #include diff --git a/ext/bcmath/libbcmath/src/raise.c b/ext/bcmath/libbcmath/src/raise.c index c7838be597..4b938cb3b3 100644 --- a/ext/bcmath/libbcmath/src/raise.c +++ b/ext/bcmath/libbcmath/src/raise.c @@ -31,7 +31,6 @@ #include #include -#include #include #include #include diff --git a/ext/bcmath/libbcmath/src/raisemod.c b/ext/bcmath/libbcmath/src/raisemod.c index a3154b55cd..9b371cc4e0 100644 --- a/ext/bcmath/libbcmath/src/raisemod.c +++ b/ext/bcmath/libbcmath/src/raisemod.c @@ -31,7 +31,6 @@ #include #include -#include #include #include #include diff --git a/ext/bcmath/libbcmath/src/rmzero.c b/ext/bcmath/libbcmath/src/rmzero.c index 1b81601b20..4751099d24 100644 --- a/ext/bcmath/libbcmath/src/rmzero.c +++ b/ext/bcmath/libbcmath/src/rmzero.c @@ -31,7 +31,6 @@ #include #include -#include #include #include #include diff --git a/ext/bcmath/libbcmath/src/sqrt.c b/ext/bcmath/libbcmath/src/sqrt.c index 265d75b5fb..ffb19fc519 100644 --- a/ext/bcmath/libbcmath/src/sqrt.c +++ b/ext/bcmath/libbcmath/src/sqrt.c @@ -31,7 +31,6 @@ #include #include -#include #include #include #include diff --git a/ext/bcmath/libbcmath/src/str2num.c b/ext/bcmath/libbcmath/src/str2num.c index 62544de80e..abf68eb1e5 100644 --- a/ext/bcmath/libbcmath/src/str2num.c +++ b/ext/bcmath/libbcmath/src/str2num.c @@ -31,7 +31,6 @@ #include #include -#include #include #include #include diff --git a/ext/bcmath/libbcmath/src/sub.c b/ext/bcmath/libbcmath/src/sub.c index b63f1bc90a..86c876d1c6 100644 --- a/ext/bcmath/libbcmath/src/sub.c +++ b/ext/bcmath/libbcmath/src/sub.c @@ -31,7 +31,6 @@ #include #include -#include #include #include #include diff --git a/ext/bcmath/libbcmath/src/zero.c b/ext/bcmath/libbcmath/src/zero.c index ffb5497546..6f0e93a026 100644 --- a/ext/bcmath/libbcmath/src/zero.c +++ b/ext/bcmath/libbcmath/src/zero.c @@ -31,7 +31,6 @@ #include #include -#include #include #include #include diff --git a/ext/mbstring/libmbfl/config.h.in b/ext/mbstring/libmbfl/config.h.in index c30fa09f4a..28bb935f93 100644 --- a/ext/mbstring/libmbfl/config.h.in +++ b/ext/mbstring/libmbfl/config.h.in @@ -1,8 +1,5 @@ /* config.h.in. Generated from configure.in by autoheader. */ -/* Define to 1 if you have the header file. */ -#undef HAVE_ASSERT_H - /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H diff --git a/ext/mbstring/libmbfl/config.h.w32 b/ext/mbstring/libmbfl/config.h.w32 index 14393a0741..4ec537284d 100644 --- a/ext/mbstring/libmbfl/config.h.w32 +++ b/ext/mbstring/libmbfl/config.h.w32 @@ -1,6 +1,5 @@ #define HAVE_STDIO_H 1 #define HAVE_STDLIB_H 1 -#define HAVE_ASSERT_H 1 #define HAVE_MEMORY_H 1 /* #undef HAVE_STRINGS_H */ #define HAVE_STRING_H 1 diff --git a/ext/standard/strnatcmp.c b/ext/standard/strnatcmp.c index 64ff8fc37d..bcbd556afe 100644 --- a/ext/standard/strnatcmp.c +++ b/ext/standard/strnatcmp.c @@ -24,7 +24,6 @@ #include #include -#include #include #include "php.h" diff --git a/main/php.h b/main/php.h index 697d3ff935..4134f7b3d4 100644 --- a/main/php.h +++ b/main/php.h @@ -123,7 +123,6 @@ typedef int pid_t; # endif #endif -#if HAVE_ASSERT_H #if PHP_DEBUG #undef NDEBUG #else @@ -132,9 +131,6 @@ typedef int pid_t; #endif #endif #include -#else /* HAVE_ASSERT_H */ -#define assert(expr) ((void) (0)) -#endif /* HAVE_ASSERT_H */ #define APACHE 0 diff --git a/main/php_syslog.c b/main/php_syslog.c index dd16f05217..2170ac70be 100644 --- a/main/php_syslog.c +++ b/main/php_syslog.c @@ -18,7 +18,6 @@ #include #include -#include #include #include "php.h" #include "php_syslog.h" diff --git a/win32/build/config.w32.h.in b/win32/build/config.w32.h.in index 4a510ea6b4..3275552b46 100644 --- a/win32/build/config.w32.h.in +++ b/win32/build/config.w32.h.in @@ -95,7 +95,6 @@ #define HAVE_TEMPNAM 1 #define HAVE_UTIME 1 #undef HAVE_DIRENT_H -#define HAVE_ASSERT_H 1 #define HAVE_FCNTL_H 1 #define HAVE_GRP_H 0 #undef HAVE_PWD_H -- 2.40.0