]> granicus.if.org Git - php/commitdiff
Remove unused PHP_AC_BROKEN_SNPRINTF m4 macro
authorPeter Kokot <peterkokot@gmail.com>
Sat, 23 Feb 2019 22:39:21 +0000 (23:39 +0100)
committerPeter Kokot <peterkokot@gmail.com>
Wed, 27 Feb 2019 20:20:30 +0000 (21:20 +0100)
The snprintf function is part of the C99 standard and newer systems in
most cases all support it as defined in the standard. However, some old
Windows and HP-UX systems the function behaves differently. These checks
were also removed and PHP now uses a replacement for the snprintf
function. With gradual transition to C99 usage as a minimum requirement,
it will also be able to be replaced to system's snprintf function
directly.

Additionally in this context the unused HAVE_VSNPRINTF and check for
vsnprintf have been removed. PHP uses its own vsnprintf implementation
for now until more reliable C99 compliant function can be used from the
C libraries.

acinclude.m4
configure.ac
main/spprintf.h
win32/build/config.w32.h.in

index 69d1638930bdb29f54075c26b218b69a09c40a7d..c6f52a0bd236be9644f6a68baf9ee614224d4fce 100644 (file)
@@ -1435,43 +1435,6 @@ AC_DEFUN([PHP_MISSING_FCLOSE_DECL],[
   ])
 ])
 
-dnl
-dnl PHP_AC_BROKEN_SNPRINTF
-dnl
-dnl Check for broken snprintf(), C99 conformance
-dnl
-AC_DEFUN([PHP_AC_BROKEN_SNPRINTF],[
-  AC_CACHE_CHECK(whether snprintf is broken, ac_cv_broken_snprintf,[
-    AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#define NULL (0L)
-main() {
-  char buf[20];
-  int res = 0;
-  res = res || (snprintf(buf, 2, "marcus") != 6);
-  res = res || (buf[1] != '\0');
-  /* Implementations may consider this as an encoding error */
-  snprintf(buf, 0, "boerger");
-  /* However, they MUST ignore the pointer */
-  res = res || (buf[0] != 'm');
-  res = res || (snprintf(NULL, 0, "boerger") != 7);
-  res = res || (snprintf(buf, sizeof(buf), "%f", 0.12345678) != 8);
-  exit(res);
-}
-    ]])],[
-      ac_cv_broken_snprintf=no
-    ],[
-      ac_cv_broken_snprintf=yes
-    ],[
-      ac_cv_broken_snprintf=no
-    ])
-  ])
-  if test "$ac_cv_broken_snprintf" = "yes"; then
-    AC_DEFINE(PHP_BROKEN_SNPRINTF, 1, [Whether snprintf is C99 conform])
-  else
-    AC_DEFINE(PHP_BROKEN_SNPRINTF, 0, [Whether snprintf is C99 conform])
-  fi
-])
-
 dnl
 dnl PHP_SOCKADDR_CHECKS
 dnl
index 697d9b789c37726513982fa8d13bf2d352edc898..9a4b77995a8c40b01db5dcb7c9d1dc67d69d02e3 100644 (file)
@@ -651,7 +651,6 @@ setsockopt \
 setvbuf \
 shutdown \
 sin \
-snprintf \
 srand48 \
 srandom \
 statfs \
@@ -673,7 +672,6 @@ unlockpt \
 unsetenv \
 usleep \
 utime \
-vsnprintf \
 vasprintf \
 asprintf \
 nanosleep \
@@ -737,7 +735,6 @@ fi
 
 AC_REPLACE_FUNCS(strlcat strlcpy explicit_bzero getopt)
 AC_FUNC_ALLOCA
-dnl PHP_AC_BROKEN_SNPRINTF
 PHP_DECLARED_TIMEZONE
 PHP_TIME_R_TYPE
 PHP_READDIR_R_TYPE
index 0bfc5a28cdf43d48359d57f9c5dbbbe3014baf13..bbb7add25ce60c39a92ee1b0c789a08f3b741e1e 100644 (file)
@@ -33,4 +33,4 @@ END_EXTERN_C()
 #define vspprintf zend_vspprintf
 #define vstrpprintf zend_vstrpprintf
 
-#endif /* SNPRINTF_H */
+#endif /* SPPRINTF_H */
index 642da0021db38493412ef44c3185604356c54c4a..ccfad0ab166e1670bd5461ef1f242918c38c2ab2 100644 (file)
@@ -86,8 +86,6 @@
 # define HAVE_SETVBUF 1
 #endif
 #define HAVE_SHUTDOWN 1
-#define HAVE_SNPRINTF 1
-#define HAVE_VSNPRINTF 1
 #define HAVE_STRCASECMP 1
 #define HAVE_STRDUP 1
 #define HAVE_STRERROR 1