Skip to content

Commit 8aec95e

Browse files
authored
Fix build on Clang 18 (php#14136)
Clang 18 only allows counted_by to work on real flexible array members, not ones with a zero size. Otherwise you get errors like: ``` ext/opcache/jit/zend_jit_ir.c:149:12: error: 'counted_by' only applies to C99 flexible array members ```
1 parent bf3c487 commit 8aec95e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ext/ffi/ffi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ typedef struct _zend_ffi_callback_data {
913913
ffi_cif cif;
914914
uint32_t arg_count;
915915
ffi_type *ret_type;
916-
ffi_type *arg_types[0] ZEND_ELEMENT_COUNT(arg_count);
916+
ffi_type *arg_types[] ZEND_ELEMENT_COUNT(arg_count);
917917
} zend_ffi_callback_data;
918918

919919
static void zend_ffi_callback_hash_dtor(zval *zv) /* {{{ */

ext/opcache/jit/zend_jit_ir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
typedef struct _ir_refs {
147147
uint32_t count;
148148
uint32_t limit;
149-
ir_ref refs[0] ZEND_ELEMENT_COUNT(count);
149+
ir_ref refs[] ZEND_ELEMENT_COUNT(count);
150150
} ir_refs;
151151

152152
#define ir_refs_size(_n) (offsetof(ir_refs, refs) + sizeof(ir_ref) * (_n))

0 commit comments

Comments
 (0)