Skip to content

Commit 175ff60

Browse files
ingamedeoiluuu1994
authored andcommitted
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
1 parent 6ba0b06 commit 175ff60

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ PHP NEWS
77
value(s)). (nielsdos)
88
. Fixed bug GH-11189 (Exceeding memory limit in zend_hash_do_resize leaves
99
the array in an invalid state). (Bob)
10+
. Fixed bug GH-11063 (Compilation error on old GCC versions). (ingamedeo)
1011

1112
- Hash:
1213
. Fixed bug GH-11180 (hash_file() appears to be restricted to 3 arguments).

Zend/zend_hash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ ZEND_API const HashTable zend_empty_array = {
240240
.gc.u.type_info = IS_ARRAY | (GC_IMMUTABLE << GC_FLAGS_SHIFT),
241241
.u.flags = HASH_FLAG_UNINITIALIZED,
242242
.nTableMask = HT_MIN_MASK,
243-
.arData = (Bucket*)&uninitialized_bucket[2],
243+
{.arData = (Bucket*)&uninitialized_bucket[2]},
244244
.nNumUsed = 0,
245245
.nNumOfElements = 0,
246246
.nTableSize = HT_MIN_SIZE,

0 commit comments

Comments
 (0)