Remove HAVE_STDARG_H

The C89 standard and later defines the `<stdarg.h>` header as part of
the standard headers [1]. On current systems it is always present and
can be included unconditionally.

Checking for presence and functionality of the `<stdarg.h>` header and
variadic function is not relevant anymore on current systems since this
is always available.

Also Autoconf suggests relying on at least C89 or above [2] and [3].

The following files were regenerated with re2c 1.0.3:
- Zend/zend_language_scanner.c
- Zend/zend_language_scanner_defs.h

Refs:
[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2] http://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
[3] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html
This commit is contained in:
Peter Kokot 2018-09-17 04:39:01 +02:00
parent d3ca28f569
commit b189c2432a
15 changed files with 357 additions and 398 deletions

View File

@ -15,10 +15,7 @@
#ifdef ZTS
#include <stdio.h>
#if HAVE_STDARG_H
#include <stdarg.h>
#endif
typedef struct _tsrm_tls_entry tsrm_tls_entry;

View File

@ -7,8 +7,6 @@ dnl AC_REQUIRE([AM_PROG_CC_STDC])dnl
AC_REQUIRE([AC_PROG_CC_C_O])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
AC_CHECK_HEADERS(stdarg.h)
AC_CHECK_FUNCS(sigprocmask)
AX_FUNC_WHICH_GETHOSTBYNAME_R()

View File

@ -51,7 +51,6 @@ stdint.h \
limits.h \
malloc.h \
unistd.h \
stdarg.h \
sys/types.h \
sys/time.h \
signal.h \

View File

@ -30,9 +30,7 @@
#include "zend_closures.h"
#include "zend_inheritance.h"
#ifdef HAVE_STDARG_H
#include <stdarg.h>
#endif
/* these variables are true statics/globals, and have to be mutex'ed on every access */
ZEND_API HashTable module_registry;

View File

@ -23,9 +23,7 @@
#include "zend.h"
#include "zend_ast.h"
#ifdef HAVE_STDARG_H
# include <stdarg.h>
#endif
#include <stdarg.h>
#include "zend_llist.h"

File diff suppressed because it is too large Load Diff

View File

@ -75,9 +75,7 @@
# error ZEND_MMAP_AHEAD should be greater than or equal to YYMAXFILL
#endif
#ifdef HAVE_STDARG_H
# include <stdarg.h>
#endif
#include <stdarg.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>

View File

@ -1,4 +1,4 @@
/* Generated by re2c 1.0.1 */
/* Generated by re2c 1.0.3 */
#line 3 "Zend/zend_language_scanner_defs.h"
enum YYCONDTYPE {

View File

@ -54,9 +54,7 @@
# include <unix.h>
#endif
#ifdef HAVE_STDARG_H
# include <stdarg.h>
#endif
#include <stdarg.h>
#ifdef HAVE_DLFCN_H
# include <dlfcn.h>

View File

@ -19,9 +19,7 @@
#include "zend.h"
#include "zend_ptr_stack.h"
#ifdef HAVE_STDARG_H
# include <stdarg.h>
#endif
#include <stdarg.h>
ZEND_API void zend_ptr_stack_init_ex(zend_ptr_stack *stack, zend_bool persistent)
{

View File

@ -21,9 +21,7 @@
#include "zend.h"
#ifdef HAVE_STDARG_H
# include <stdarg.h>
#endif
#include <stdarg.h>
#if ZEND_BROKEN_SPRINTF
int zend_sprintf(char *buffer, const char *format, ...)

View File

@ -32,9 +32,7 @@
#include <utime.h>
#endif
#ifdef HAVE_STDARG_H
#include <stdarg.h>
#endif
#ifdef ZTS
#define VIRTUAL_DIR

View File

@ -442,7 +442,6 @@ poll.h \
pwd.h \
resolv.h \
signal.h \
stdarg.h \
syslog.h \
sysexits.h \
sys/ioctl.h \

View File

@ -77,24 +77,7 @@ AC_DEFUN([PHP_MBSTRING_SETUP_MBREGEX], [
AC_DEFINE([USE_COMBINATION_EXPLOSION_CHECK],1,[whether to check multibyte regex backtrack])
fi
AC_CACHE_CHECK(for variable length prototypes and stdarg.h, php_cv_mbstring_stdarg, [
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdarg.h>
int foo(int x, ...) {
va_list va;
va_start(va, x);
va_arg(va, int);
va_arg(va, char *);
va_arg(va, double);
return 0;
}
int main() { return foo(10, "", 3.14); }
]])], [php_cv_mbstring_stdarg=yes], [php_cv_mbstring_stdarg=no], [
php_cv_mbstring_stdarg=no
])
])
AC_CHECK_HEADERS([strings.h unistd.h sys/time.h sys/times.h stdarg.h limits.h])
AC_CHECK_HEADERS([strings.h unistd.h sys/time.h sys/times.h limits.h])
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(short, 2)
AC_CHECK_SIZEOF(long, 4)

View File

@ -104,7 +104,6 @@
#define HAVE_SYSLOG_H 1
#undef HAVE_UNISTD_H
#define HAVE_SYS_TYPES_H 1
#define HAVE_STDARG_H 1
#undef HAVE_ALLOCA_H
#undef HAVE_KILL
#define HAVE_GETPID 1