Skip to content

Commit 6a2fab5

Browse files
committed
gh-144048: Use flexible array members
Not all cases can be converted because some structs with this are members in the middle of bigger structs, so changing them introduces warnings. Leave them alone for now.
1 parent f84ea11 commit 6a2fab5

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Include/cpython/pystate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ typedef struct _stack_chunk {
5858
struct _stack_chunk *previous;
5959
size_t size;
6060
size_t top;
61-
PyObject * data[1]; /* Variable sized */
61+
PyObject * data[];
6262
} _PyStackChunk;
6363

6464
/* Minimum size of data stack chunk */

Modules/_sre/sre.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ typedef struct {
6565
struct {
6666
Py_ssize_t index;
6767
PyObject *literal; /* NULL if empty */
68-
} items[0];
68+
} items[];
6969
} TemplateObject;
7070

7171
typedef struct SRE_REPEAT_T {

Objects/memoryobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ memoryview__from_flags_impl(PyTypeObject *type, PyObject *object, int flags)
10421042

10431043
typedef struct {
10441044
Py_buffer view;
1045-
Py_ssize_t array[1];
1045+
Py_ssize_t array[];
10461046
} Py_buffer_full;
10471047

10481048
int

0 commit comments

Comments
 (0)