fix: remove non-conforming size-0 arrays (#5564)
In C, these are supported only as a vendor extension; they should instead use proper C99 flexible array members. In C++, both `[]` and `[0]` are vendor extensions. Co-authored-by: Thomas Köppe <tkoeppe@google.com>
This commit is contained in:
parent
d4195c2605
commit
e90c3cf15a
1 changed files with 5 additions and 5 deletions
|
|
@ -151,7 +151,7 @@ typedef lean_object * b_lean_obj_res; /* Borrowed object result. */
|
|||
|
||||
typedef struct {
|
||||
lean_object m_header;
|
||||
lean_object * m_objs[0];
|
||||
lean_object * m_objs[];
|
||||
} lean_ctor_object;
|
||||
|
||||
/* Array arrays */
|
||||
|
|
@ -159,7 +159,7 @@ typedef struct {
|
|||
lean_object m_header;
|
||||
size_t m_size;
|
||||
size_t m_capacity;
|
||||
lean_object * m_data[0];
|
||||
lean_object * m_data[];
|
||||
} lean_array_object;
|
||||
|
||||
/* Scalar arrays */
|
||||
|
|
@ -167,7 +167,7 @@ typedef struct {
|
|||
lean_object m_header;
|
||||
size_t m_size;
|
||||
size_t m_capacity;
|
||||
uint8_t m_data[0];
|
||||
uint8_t m_data[];
|
||||
} lean_sarray_object;
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -175,7 +175,7 @@ typedef struct {
|
|||
size_t m_size; /* byte length including '\0' terminator */
|
||||
size_t m_capacity;
|
||||
size_t m_length; /* UTF8 length */
|
||||
char m_data[0];
|
||||
char m_data[];
|
||||
} lean_string_object;
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -183,7 +183,7 @@ typedef struct {
|
|||
void * m_fun;
|
||||
uint16_t m_arity; /* Number of arguments expected by m_fun. */
|
||||
uint16_t m_num_fixed; /* Number of arguments that have been already fixed. */
|
||||
lean_object * m_objs[0];
|
||||
lean_object * m_objs[];
|
||||
} lean_closure_object;
|
||||
|
||||
typedef struct {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue