Browse Source

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
pull/3528/merge
Peter Kokot 7 years ago
parent
commit
b189c2432a
  1. 3
      TSRM/TSRM.c
  2. 2
      TSRM/tsrm.m4
  3. 1
      Zend/Zend.m4
  4. 2
      Zend/zend_API.c
  5. 4
      Zend/zend_compile.h
  6. 702
      Zend/zend_language_scanner.c
  7. 4
      Zend/zend_language_scanner.l
  8. 2
      Zend/zend_language_scanner_defs.h
  9. 4
      Zend/zend_portability.h
  10. 4
      Zend/zend_ptr_stack.c
  11. 4
      Zend/zend_sprintf.c
  12. 2
      Zend/zend_virtual_cwd.h
  13. 1
      configure.ac
  14. 19
      ext/mbstring/config.m4
  15. 1
      win32/build/config.w32.h.in

3
TSRM/TSRM.c

@ -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;

2
TSRM/tsrm.m4

@ -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()

1
Zend/Zend.m4

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

2
Zend/zend_API.c

@ -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;

4
Zend/zend_compile.h

@ -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"

702
Zend/zend_language_scanner.c
File diff suppressed because it is too large
View File

4
Zend/zend_language_scanner.l

@ -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>

2
Zend/zend_language_scanner_defs.h

@ -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 {

4
Zend/zend_portability.h

@ -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>

4
Zend/zend_ptr_stack.c

@ -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)
{

4
Zend/zend_sprintf.c

@ -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, ...)

2
Zend/zend_virtual_cwd.h

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

1
configure.ac

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

19
ext/mbstring/config.m4

@ -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)

1
win32/build/config.w32.h.in

@ -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

Loading…
Cancel
Save