From 175ff603c3a8ae9dd3e6ccb3fc3081b06263f989 Mon Sep 17 00:00:00 2001 From: Amedeo Baragiola Date: Tue, 9 May 2023 19:09:42 +0100 Subject: [PATCH] Fix compilation error on old GCC versions In older versions of GCC (<=4.5) designated initializers would not accept member names nested inside anonymous structures. Instead, we need to use a positional member wrapped in {}. Fixes GH-11063 Closes GH-11212 --- NEWS | 1 + Zend/zend_hash.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 050955d207f..6a4a49b1cfb 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,7 @@ PHP NEWS value(s)). (nielsdos) . Fixed bug GH-11189 (Exceeding memory limit in zend_hash_do_resize leaves the array in an invalid state). (Bob) + . Fixed bug GH-11063 (Compilation error on old GCC versions). (ingamedeo) - Hash: . Fixed bug GH-11180 (hash_file() appears to be restricted to 3 arguments). diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c index 49c0df61436..58e5b40d050 100644 --- a/Zend/zend_hash.c +++ b/Zend/zend_hash.c @@ -240,7 +240,7 @@ ZEND_API const HashTable zend_empty_array = { .gc.u.type_info = IS_ARRAY | (GC_IMMUTABLE << GC_FLAGS_SHIFT), .u.flags = HASH_FLAG_UNINITIALIZED, .nTableMask = HT_MIN_MASK, - .arData = (Bucket*)&uninitialized_bucket[2], + {.arData = (Bucket*)&uninitialized_bucket[2]}, .nNumUsed = 0, .nNumOfElements = 0, .nTableSize = HT_MIN_SIZE,