summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Peter Banyard <girgias@php.net>2020-01-15 17:06:02 +0100
committerGeorge Peter Banyard <girgias@php.net>2020-01-20 23:03:10 +0100
commitaaa1f90e3f90c24098fa55a7b868fdca0b89ee25 (patch)
tree4e09939dbc8aa9cc4e7d82808e37c82db4f82b93
parent691880b22c1ebdf7b58a25e599d2ba41c72b1dfa (diff)
downloadphp-git-aaa1f90e3f90c24098fa55a7b868fdca0b89ee25.tar.gz
Drop the custom I length modifier from snprintf custom implementation.
Extensions should rather use the ZEND_LONG_FMT, ZEND_ULONG_FMT and ZEND_XLONG_FMT macros defined in php-src/Zend/zend_long.h Closes GH-5089
-rw-r--r--UPGRADING.INTERNALS5
-rw-r--r--main/snprintf.c19
2 files changed, 5 insertions, 19 deletions
diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS
index 7c4ed27a62..62492bab39 100644
--- a/UPGRADING.INTERNALS
+++ b/UPGRADING.INTERNALS
@@ -80,6 +80,11 @@ PHP 8.0 INTERNALS UPGRADE NOTES
j. compare_objects() handler was removed. Extensions should use compare() object
handler instead and check if both arguments are objects and have the same
compare handler, using ZEND_COMPARE_OBJECTS_FALLBACK() macro.
+
+ k. The 'I' length modifier, used to denote 32 and 64bit integer from the custom
+ snprintf implementation has been removed.
+ Use the ZEND_LONG_FMT, ZEND_ULONG_FMT and ZEND_XLONG_FMT macros defined in
+ php-src/Zend/zend_long.h
========================
2. Build system changes
diff --git a/main/snprintf.c b/main/snprintf.c
index 1acbf10dfb..2dd2aa276f 100644
--- a/main/snprintf.c
+++ b/main/snprintf.c
@@ -712,25 +712,6 @@ static int format_converter(register buffy * odp, const char *fmt, va_list ap) /
fmt++;
modifier = LM_LONG_DOUBLE;
break;
- case 'I':
- fmt++;
-#if SIZEOF_LONG_LONG
- if (*fmt == '6' && *(fmt+1) == '4') {
- fmt += 2;
- modifier = LM_LONG_LONG;
- } else
-#endif
- if (*fmt == '3' && *(fmt+1) == '2') {
- fmt += 2;
- modifier = LM_LONG;
- } else {
-#ifdef _WIN64
- modifier = LM_LONG_LONG;
-#else
- modifier = LM_LONG;
-#endif
- }
- break;
case 'l':
fmt++;
#if SIZEOF_LONG_LONG