From aaa1f90e3f90c24098fa55a7b868fdca0b89ee25 Mon Sep 17 00:00:00 2001 From: George Peter Banyard Date: Wed, 15 Jan 2020 17:06:02 +0100 Subject: [PATCH] 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 --- UPGRADING.INTERNALS | 5 +++++ main/snprintf.c | 19 ------------------- 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 -- 2.50.1